@tea-agent/loop-agent 0.13.0-alpha.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +4 -0
- package/CHANGELOG.md +57 -53
- package/README.md +12 -3
- package/dist/application/dag/generate-task-dag.js +28 -58
- package/dist/application/evaluation/candidate-hash.js +75 -0
- package/dist/application/evaluation/candidate.js +52 -0
- package/dist/application/evaluation/replay.js +289 -0
- package/dist/application/evaluation/types.js +130 -0
- package/dist/cli/command-definitions.js +17 -4
- package/dist/cli/program.js +8 -4
- package/dist/commands/eval.js +235 -0
- package/dist/commands/init.js +131 -24
- package/dist/executors/pi-sdk-executor.js +38 -24
- package/dist/executors/shell-executor.js +226 -15
- package/dist/executors/shell-presets.js +20 -0
- package/dist/executors/shell-verification.js +7 -0
- package/dist/governance/manifest-types.js +1 -0
- package/dist/infrastructure/evaluation/candidate-store.js +439 -0
- package/dist/infrastructure/evaluation/store.js +40 -0
- package/dist/task/config-types.js +23 -0
- package/dist/worker/observe/routes.js +18 -3
- package/dist/worker/observe/spec-evidence.js +1 -1
- package/dist/worker/observe/static/dom.js +160 -1
- package/dist/worker/observe/static/state.js +14 -0
- package/dist/worker/observe/static/views/dag-inspector.js +35 -4
- package/dist/worker/observe/static/views/dag.js +9 -0
- package/dist/worker/observe/static/views/dashboard.js +702 -445
- package/dist/worker/observe/static/views/session-timeline.js +15 -1
- package/dist/workflows/dag/backend-test-analysis-contract.js +120 -0
- package/dist/workflows/dag/backend-test-case-manifest.js +503 -0
- package/dist/workflows/dag/backend-test-execution-contract.js +353 -0
- package/dist/workflows/dag/backend-test-result-contract.js +568 -0
- package/dist/workflows/dag/decision-envelope.js +57 -2
- package/dist/workflows/dag/dynamic-runtime/map.js +90 -2
- package/dist/workflows/dag/frontend-implementation-contract.js +240 -0
- package/dist/workflows/dag/frontend-project-capability.js +309 -0
- package/dist/workflows/dag/frontend-repair.js +341 -0
- package/dist/workflows/dag/frontend-risk.js +161 -0
- package/dist/workflows/dag/frontend-verification-trace.js +190 -0
- package/dist/workflows/dag/init-hybrid.js +2407 -297
- package/dist/workflows/dag/node-execution.js +9 -0
- package/dist/workflows/dag/prompt.js +9 -0
- package/dist/workflows/dag/repair-artifact.js +43 -3
- package/dist/workflows/dag/report.js +35 -1
- package/dist/workflows/dag/runner.js +28 -2
- package/dist/workflows/dag/skill-instructions.js +4 -2
- package/dist/workflows/dag/task-demand-routing.js +383 -0
- package/dist/workflows/dag/types.js +71 -13
- package/dist/workflows/dag/upstream-artifacts.js +1 -0
- package/dist/workflows/dag/validate.js +59 -1
- package/docs/README.md +6 -3
- package/docs/agent-dag-recovery-playbook.md +5 -3
- package/docs/agent-dag-runner.md +3 -3
- package/docs/architecture/README.md +3 -3
- package/docs/architecture/dag-execution.md +1 -1
- package/docs/architecture/evolution.md +13 -13
- package/docs/architecture/facts-and-state.md +1 -1
- package/docs/architecture/runtime-boundaries.md +7 -7
- package/docs/architecture/system-overview.md +3 -3
- package/docs/architecture/worker-and-feature.md +3 -3
- package/docs/design/README.md +124 -42
- package/docs/development-principles.md +4 -4
- package/docs/exec-plans/active/README.md +12 -11
- package/docs/exec-plans/completed/README.md +33 -0
- package/docs/feature-workflow.md +114 -39
- package/docs/init-surface.manifest.json +30 -3
- package/docs/loop-agent-harness.md +9 -8
- package/docs/production-readiness.md +1 -1
- package/docs/progress/README.md +23 -1
- package/docs/reports/README.md +65 -6
- package/docs/skills/vetted-skill-registry.md +2 -0
- package/docs/templates/agent-dag.schema.json +29 -1
- package/docs/templates/agent-dag.supervised-implementation.json +127 -8
- package/docs/templates/backend-test-analysis.schema.json +44 -0
- package/docs/templates/backend-test-case-manifest.schema.json +190 -0
- package/docs/templates/backend-test-dag.classify.prompt.md +75 -0
- package/docs/templates/backend-test-dag.generate-pytest.prompt.md +81 -16
- package/docs/templates/backend-test-dag.json +311 -40
- package/docs/templates/backend-test-dag.retrospect.prompt.md +44 -30
- package/docs/templates/backend-test-dag.review-cases.prompt.md +10 -8
- package/docs/templates/backend-test-execution.schema.json +133 -0
- package/docs/templates/backend-test-result.schema.json +99 -0
- package/docs/templates/branch-merge-report.md +93 -0
- package/docs/templates/frontend-design-contract.md +9 -0
- package/docs/templates/frontend-eval/fixtures/failures/01-type-build-error.md +17 -0
- package/docs/templates/frontend-eval/fixtures/failures/02-unit-component-test-fail.md +16 -0
- package/docs/templates/frontend-eval/fixtures/failures/03-fixture-schema-drift.md +16 -0
- package/docs/templates/frontend-eval/fixtures/failures/04-missing-loading-empty-error-state.md +16 -0
- package/docs/templates/frontend-eval/fixtures/failures/05-forbidden-write-writeset-expansion.md +16 -0
- package/docs/templates/frontend-eval/fixtures/failures/06-unapproved-dependency-add.md +16 -0
- package/docs/templates/frontend-eval/fixtures/failures/07-mock-production-on.md +21 -0
- package/docs/templates/frontend-eval/fixtures/functional/01-simple-component-style.md +29 -0
- package/docs/templates/frontend-eval/fixtures/functional/02-form-validation.md +28 -0
- package/docs/templates/frontend-eval/fixtures/functional/03-list-detail-page.md +28 -0
- package/docs/templates/frontend-eval/fixtures/functional/04-api-mock.md +29 -0
- package/docs/templates/frontend-eval/fixtures/functional/05-permission-auth-gated-ui.md +27 -0
- package/docs/templates/frontend-eval/fixtures/functional/06-ssr-server-client-boundary.md +28 -0
- package/docs/templates/frontend-eval/fixtures/functional/07-shared-public-component-api.md +28 -0
- package/docs/templates/frontend-eval/fixtures/functional/08-pure-local-no-remote.md +27 -0
- package/docs/templates/frontend-eval/metrics.md +138 -0
- package/docs/templates/frontend-eval/smoke-targets.md +53 -0
- package/docs/templates/frontend-implementation-contract.schema.json +27 -0
- package/docs/templates/frontend-task-constraints.md +10 -0
- package/docs/templates/frontend-task-requirement.md +9 -0
- package/docs/templates/frontend-test-dag.generate-cases.prompt.md +5 -0
- package/docs/templates/frontend-test-dag.json +23 -0
- package/docs/templates/frontend-test-dag.retrieve-context.prompt.md +3 -0
- package/docs/templates/frontend-test-dag.retrospect.prompt.md +3 -0
- package/docs/templates/frontend-test-dag.review-cases.prompt.md +3 -0
- package/docs/templates/frontend-test-dag.review-execution.prompt.md +3 -0
- package/docs/templates/knowledge-graph-bootstrap-dag.json +1 -1
- package/docs/templates/knowledge-sync-dag.json +1 -0
- package/docs/verification-matrix.md +4 -1
- package/examples/decision-gate-agent-dag.json +4 -4
- package/examples/hybrid-loop-agent-dag.json +1 -1
- package/package.json +2 -2
- package/scripts/kb-bootstrap-init-skeleton.sh +2 -1
- package/scripts/kb-graph-incremental-prepare.mjs +19 -5
- package/scripts/kb-graph-promote.mjs +12 -1
- package/skills/ai-engineering-context/SKILL.md +2 -2
- package/skills/analyze-product-dependencies/SKILL.md +67 -0
- package/skills/analyze-product-dependencies/agents/openai.yaml +4 -0
- package/skills/analyze-product-dependencies/references/api-documentation-schema.md +30 -0
- package/skills/analyze-product-dependencies/references/dependency-analysis-schema.md +28 -0
- package/skills/analyze-product-dependencies/references/example.md +76 -0
- package/skills/analyze-product-dependencies/references/forward-test-cases.md +35 -0
- package/skills/analyze-product-dependencies/references/input-contract.md +11 -0
- package/skills/analyze-product-dependencies/references/scouting-rules.md +61 -0
- package/skills/analyze-product-dependencies/scripts/test-validators.mjs +267 -0
- package/skills/analyze-product-dependencies/scripts/validate-api-documentation.mjs +101 -0
- package/skills/analyze-product-dependencies/scripts/validate-dependency-analysis.mjs +142 -0
- package/skills/analyze-product-dependencies/scripts/validate-product-requirement-input.mjs +76 -0
- package/skills/analyze-product-dependencies/scripts/validation-helpers.mjs +146 -0
- package/skills/analyze-product-requirements/SKILL.md +90 -0
- package/skills/analyze-product-requirements/agents/openai.yaml +4 -0
- package/skills/analyze-product-requirements/references/acceptance-criteria.md +91 -0
- package/skills/analyze-product-requirements/references/clarification-and-knowledge.md +56 -0
- package/skills/analyze-product-requirements/references/example.md +86 -0
- package/skills/analyze-product-requirements/references/forward-test-cases.md +66 -0
- package/skills/analyze-product-requirements/references/product-analysis-schema.md +32 -0
- package/skills/analyze-product-requirements/references/product-requirement-schema.md +33 -0
- package/skills/analyze-product-requirements/references/requirement-clarification-schema.md +35 -0
- package/skills/analyze-product-requirements/scripts/test-validators.mjs +193 -0
- package/skills/analyze-product-requirements/scripts/validate-product-analysis.mjs +69 -0
- package/skills/analyze-product-requirements/scripts/validate-product-requirement.mjs +97 -0
- package/skills/analyze-product-requirements/scripts/validate-requirement-clarification.mjs +98 -0
- package/skills/analyze-product-requirements/scripts/validation-helpers.mjs +156 -0
- package/skills/browser-tools/SKILL.md +196 -0
- package/skills/browser-tools/browser-content.js +103 -0
- package/skills/browser-tools/browser-cookies.js +35 -0
- package/skills/browser-tools/browser-eval.js +53 -0
- package/skills/browser-tools/browser-hn-scraper.js +108 -0
- package/skills/browser-tools/browser-nav.js +44 -0
- package/skills/browser-tools/browser-pick.js +162 -0
- package/skills/browser-tools/browser-screenshot.js +34 -0
- package/skills/browser-tools/browser-start.js +86 -0
- package/skills/browser-tools/package-lock.json +2556 -0
- package/skills/browser-tools/package.json +19 -0
- package/skills/frontend-design-review/SKILL.md +6 -1
- package/skills/frontend-design-review/references/review-checklist.md +25 -4
- package/skills/frontend-implementation/SKILL.md +25 -30
- package/skills/frontend-implementation/references/code-standards.md +20 -22
- package/skills/frontend-implementation/references/node-contracts.md +17 -53
- package/skills/frontend-review/SKILL.md +10 -4
- package/skills/frontend-review/references/review-findings.md +8 -3
- package/skills/frontend-verification/SKILL.md +22 -9
- package/skills/frontend-verification/references/verification-checklist.md +17 -5
- package/skills/grill-with-docs/SKILL.md +5 -5
- package/skills/grill-with-docs/adr-format.md +3 -3
- package/skills/init-capability-evolution/SKILL.md +5 -5
- package/skills/loop-agent/SKILL.md +5 -5
- package/skills/loop-agent/references/README.md +3 -3
- package/skills/loop-agent/references/command-reference.md +98 -24
- package/skills/loop-agent/references/docs-converge.md +15 -15
- package/skills/loop-agent/references/harness-policy.md +2 -2
- package/skills/loop-agent/references/hybrid-dag.md +32 -22
- package/skills/loop-agent/references/multi-worktree.md +1 -1
- package/skills/loop-agent/references/orchestrator-and-interventions.md +8 -8
- package/skills/loop-agent/references/task-workflow.md +1 -1
- package/skills/loop-agent/references/verification-and-failure-handling.md +6 -4
- package/skills/playwright-cli/SKILL.md +420 -0
- package/skills/playwright-cli/references/element-attributes.md +23 -0
- package/skills/playwright-cli/references/playwright-tests.md +39 -0
- package/skills/playwright-cli/references/request-mocking.md +87 -0
- package/skills/playwright-cli/references/running-code.md +241 -0
- package/skills/playwright-cli/references/session-management.md +225 -0
- package/skills/playwright-cli/references/storage-state.md +275 -0
- package/skills/playwright-cli/references/test-generation.md +433 -0
- package/skills/playwright-cli/references/tracing.md +139 -0
- package/skills/playwright-cli/references/video-recording.md +143 -0
- package/skills/playwright-cli-case-generator/SKILL.md +74 -0
- package/skills/requesting-code-review/SKILL.md +1 -1
- package/skills/systematic-debugging/CREATION-LOG.md +3 -3
- package/skills/systematic-debugging/SKILL.md +1 -1
- package/skills/systematic-debugging/test-academic.md +1 -1
- package/skills/systematic-debugging/test-pressure-1.md +1 -1
- package/skills/systematic-debugging/test-pressure-2.md +1 -1
- package/skills/systematic-debugging/test-pressure-3.md +1 -1
- package/skills/verification-before-completion/SKILL.md +1 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Failure fixture: Mock production-on / real-request commented out
|
|
2
|
+
|
|
3
|
+
- **fixtureId**: `fe-fail-mock-production-on`
|
|
4
|
+
- **triggerSignal**: 生产入口默认启用 Mock、注释真实请求、或 production import test mocks
|
|
5
|
+
- **expectedGateBehavior**: design/review 至少 Important → request-revision;static production/default-real-path 检查应失败或 review 阻断
|
|
6
|
+
- **repairable (M3 预标注)**: `repairable` 若仅激活边界错误;`non-repairable` 若故意绕过合同
|
|
7
|
+
- **Browser**: not-run;Mock UI 观感不得当真实联调
|
|
8
|
+
|
|
9
|
+
## 场景
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
// fetch('/api/users')
|
|
13
|
+
return mockUsers;
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
或 `mock.enable()` 无 dev/test 守卫。
|
|
17
|
+
|
|
18
|
+
## 期望
|
|
19
|
+
|
|
20
|
+
- 计入潜在 `mock_real_integration_false_claim` 若 closeout 美化
|
|
21
|
+
- 与 mock workflow 生产默认真实路径规则一致
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Functional fixture: simple component / style
|
|
2
|
+
|
|
3
|
+
- **fixtureId**: `fe-func-simple-component-style`
|
|
4
|
+
- **taskTitle**: 调整 Button 次要样式以匹配设计 token
|
|
5
|
+
- **expectedRoute**: `frontend-implementation`
|
|
6
|
+
- **expectedRiskLevel**: `small`(M4 前仅标注)
|
|
7
|
+
- **expectedGateIntensity**: standard dual design + mock assess;无 API 时倾向 `not-needed`
|
|
8
|
+
- **expectedMockStrategy**: `not-needed`(无远程数据)
|
|
9
|
+
- **Browser**: **out-of-scope / not-run**
|
|
10
|
+
|
|
11
|
+
## 需求要点
|
|
12
|
+
|
|
13
|
+
- 修改既有展示型组件 className / CSS module / token 引用。
|
|
14
|
+
- 不改变公共 props API。
|
|
15
|
+
- 覆盖 hover/disabled 若设计要求;无 loading/empty 则 N/A 并说明。
|
|
16
|
+
|
|
17
|
+
## allowedPaths 建议
|
|
18
|
+
|
|
19
|
+
```text
|
|
20
|
+
src/components/Button/**
|
|
21
|
+
src/styles/**
|
|
22
|
+
test/components/Button/**
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## expected verification 形态
|
|
26
|
+
|
|
27
|
+
- Static: `typecheck` + `build`(fallback 可接受)
|
|
28
|
+
- Behavior: 组件单测或 style snapshot 类 vitest(无浏览器)
|
|
29
|
+
- 无 `frontend-mock-verify-shell`
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Functional fixture: form validation
|
|
2
|
+
|
|
3
|
+
- **fixtureId**: `fe-func-form-validation`
|
|
4
|
+
- **taskTitle**: 实现登录表单客户端校验与错误提示
|
|
5
|
+
- **expectedRoute**: `frontend-implementation`
|
|
6
|
+
- **expectedRiskLevel**: `standard`
|
|
7
|
+
- **expectedGateIntensity**: dual design;UI states 含 error/empty 输入
|
|
8
|
+
- **expectedMockStrategy**: `not-needed` 若仅客户端校验;若提交到 API 则为 native/request-adapter
|
|
9
|
+
- **Browser**: **out-of-scope / not-run**
|
|
10
|
+
|
|
11
|
+
## 需求要点
|
|
12
|
+
|
|
13
|
+
- 必填、格式、确认字段一致性。
|
|
14
|
+
- 提交中 loading、校验失败 error message、成功 success 反馈。
|
|
15
|
+
- 不得默认 Mock 掉真实提交路径。
|
|
16
|
+
|
|
17
|
+
## allowedPaths 建议
|
|
18
|
+
|
|
19
|
+
```text
|
|
20
|
+
src/components/LoginForm/**
|
|
21
|
+
src/pages/login/**
|
|
22
|
+
test/components/LoginForm/**
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## expected verification 形态
|
|
26
|
+
|
|
27
|
+
- Static: typecheck/build
|
|
28
|
+
- Behavior: 组件/单元测试覆盖 invalid/valid 路径
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Functional fixture: list/detail page
|
|
2
|
+
|
|
3
|
+
- **fixtureId**: `fe-func-list-detail-page`
|
|
4
|
+
- **taskTitle**: 实现订单列表与详情路由页面
|
|
5
|
+
- **expectedRoute**: `frontend-implementation`
|
|
6
|
+
- **expectedRiskLevel**: `standard`
|
|
7
|
+
- **expectedGateIntensity**: dual design + 状态覆盖(loading/empty/error/success)
|
|
8
|
+
- **expectedMockStrategy**: 有 API 时 `native` 或 `request-adapter`;policy=auto
|
|
9
|
+
- **Browser**: **out-of-scope / not-run**
|
|
10
|
+
|
|
11
|
+
## 需求要点
|
|
12
|
+
|
|
13
|
+
- 列表分页或筛选;详情根据 id 加载。
|
|
14
|
+
- loading / empty / error / success 四态可测。
|
|
15
|
+
- Real Integration Gap 在 closeout 保留(若仅 Mock)。
|
|
16
|
+
|
|
17
|
+
## allowedPaths 建议
|
|
18
|
+
|
|
19
|
+
```text
|
|
20
|
+
src/pages/orders/**
|
|
21
|
+
src/components/orders/**
|
|
22
|
+
src/api/orders/**
|
|
23
|
+
test/pages/orders/**
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## expected verification 形态
|
|
27
|
+
|
|
28
|
+
- Static + behavior(路由/组件测试,非 e2e 浏览器)
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Functional fixture: API + Mock
|
|
2
|
+
|
|
3
|
+
- **fixtureId**: `fe-func-api-mock`
|
|
4
|
+
- **taskTitle**: 接入用户列表 API 并在本地用既有 MSW Mock 验证
|
|
5
|
+
- **expectedRoute**: `frontend-implementation`
|
|
6
|
+
- **expectedRiskLevel**: `standard`
|
|
7
|
+
- **expectedGateIntensity**: mock assess + mock contract gate;required 时可能含 mock-verify
|
|
8
|
+
- **expectedMockStrategy**: `native`(既有 MSW)优先
|
|
9
|
+
- **Browser**: **out-of-scope / not-run**
|
|
10
|
+
|
|
11
|
+
## 需求要点
|
|
12
|
+
|
|
13
|
+
- Fixture 字段对齐接口文档;禁止发明字段。
|
|
14
|
+
- 生产默认真实请求;Mock 仅 test/dev 显式激活。
|
|
15
|
+
- closeout:`Frontend status: mock-validated`,`Real integration: pending`。
|
|
16
|
+
|
|
17
|
+
## allowedPaths 建议
|
|
18
|
+
|
|
19
|
+
```text
|
|
20
|
+
src/features/users/**
|
|
21
|
+
src/mocks/**
|
|
22
|
+
test/features/users/**
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## expected verification 形态
|
|
26
|
+
|
|
27
|
+
- Static(含 production/default-real-path 构建)
|
|
28
|
+
- Behavior(Mock 激活下状态)
|
|
29
|
+
- 可选 `npm run test:mock` → `frontend-mock-verify-shell`
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Functional fixture: permission / auth-gated UI
|
|
2
|
+
|
|
3
|
+
- **fixtureId**: `fe-func-permission-auth-ui`
|
|
4
|
+
- **taskTitle**: 管理后台菜单按角色隐藏未授权入口
|
|
5
|
+
- **expectedRoute**: `frontend-implementation`
|
|
6
|
+
- **expectedRiskLevel**: `high-risk`(M4 前仅标注)
|
|
7
|
+
- **expectedGateIntensity**: dual design 保留;权限矩阵进 plan
|
|
8
|
+
- **expectedMockStrategy**: 若角色来自 API 则 Mock/adapter;纯 prop 驱动可为 not-needed
|
|
9
|
+
- **Browser**: **out-of-scope / not-run**
|
|
10
|
+
|
|
11
|
+
## 需求要点
|
|
12
|
+
|
|
13
|
+
- 未授权不渲染危险操作;无权限 empty/forbidden 态。
|
|
14
|
+
- 不得在客户端硬编码绕过鉴权当作完成。
|
|
15
|
+
- 安全相关不得扩大 writeSet 到服务端密钥配置。
|
|
16
|
+
|
|
17
|
+
## allowedPaths 建议
|
|
18
|
+
|
|
19
|
+
```text
|
|
20
|
+
src/features/admin/nav/**
|
|
21
|
+
src/hooks/usePermission/**
|
|
22
|
+
test/features/admin/**
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## expected verification 形态
|
|
26
|
+
|
|
27
|
+
- Static + 权限矩阵单测/组件测
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Functional fixture: SSR / server-client boundary (Next 风格)
|
|
2
|
+
|
|
3
|
+
- **fixtureId**: `fe-func-ssr-server-client-boundary`
|
|
4
|
+
- **taskTitle**: 在 Next App Router 中拆分服务端数据区与客户端交互岛
|
|
5
|
+
- **expectedRoute**: `frontend-implementation`
|
|
6
|
+
- **expectedRiskLevel**: `high-risk`(M4 前仅标注)
|
|
7
|
+
- **expectedGateIntensity**: dual design;明确 server/client 边界与禁止事项
|
|
8
|
+
- **expectedMockStrategy**: server fetch 真实或 adapter;client 交互本地;禁止生产默认 Mock
|
|
9
|
+
- **Browser**: **out-of-scope / not-run**
|
|
10
|
+
|
|
11
|
+
## 需求要点
|
|
12
|
+
|
|
13
|
+
- `"use client"` 边界正确;不把仅服务端 API 密钥导入 client bundle。
|
|
14
|
+
- loading/error 在允许的边界内处理。
|
|
15
|
+
- smoke target 优先 `nextjs-min`(temp dir)。
|
|
16
|
+
|
|
17
|
+
## allowedPaths 建议
|
|
18
|
+
|
|
19
|
+
```text
|
|
20
|
+
app/dashboard/**
|
|
21
|
+
src/components/dashboard/**
|
|
22
|
+
test/dashboard/**
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## expected verification 形态
|
|
26
|
+
|
|
27
|
+
- Static: typecheck / next build(temp)
|
|
28
|
+
- Behavior: 单元/组件测试;**不**将 `next start` 浏览器访问作为完成证据
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Functional fixture: shared / public component API change
|
|
2
|
+
|
|
3
|
+
- **fixtureId**: `fe-func-shared-public-component-api`
|
|
4
|
+
- **taskTitle**: 为设计系统 Input 增加 `size` prop 并更新导出类型
|
|
5
|
+
- **expectedRoute**: `frontend-implementation`
|
|
6
|
+
- **expectedRiskLevel**: `high-risk`(公共 API;M4 前仅标注)
|
|
7
|
+
- **expectedGateIntensity**: dual design;依赖与 breaking change 审查
|
|
8
|
+
- **expectedMockStrategy**: `not-needed`
|
|
9
|
+
- **Browser**: **out-of-scope / not-run**
|
|
10
|
+
|
|
11
|
+
## 需求要点
|
|
12
|
+
|
|
13
|
+
- 公共 props/类型变更需兼容策略(可选 prop 默认值或变更说明)。
|
|
14
|
+
- 更新导出与既有测试;不得静默删测试。
|
|
15
|
+
- writeSet 限于组件包约定路径。
|
|
16
|
+
|
|
17
|
+
## allowedPaths 建议
|
|
18
|
+
|
|
19
|
+
```text
|
|
20
|
+
packages/ui/src/Input/**
|
|
21
|
+
packages/ui/src/index.ts
|
|
22
|
+
packages/ui/src/Input/*.test.*
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## expected verification 形态
|
|
26
|
+
|
|
27
|
+
- Static: typecheck/build
|
|
28
|
+
- Behavior: 组件 API 单测
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Functional fixture: pure local no-remote interaction
|
|
2
|
+
|
|
3
|
+
- **fixtureId**: `fe-func-pure-local-no-remote`
|
|
4
|
+
- **taskTitle**: 实现纯前端计数器与本地 localStorage 偏好
|
|
5
|
+
- **expectedRoute**: `frontend-implementation`
|
|
6
|
+
- **expectedRiskLevel**: `small`(M4 前仅标注)
|
|
7
|
+
- **expectedGateIntensity**: mock assess 仍存在但策略应为 not-needed
|
|
8
|
+
- **expectedMockStrategy**: `not-needed`(正证据:无远程 API)
|
|
9
|
+
- **Browser**: **out-of-scope / not-run**
|
|
10
|
+
|
|
11
|
+
## 需求要点
|
|
12
|
+
|
|
13
|
+
- 状态仅存组件 state / localStorage。
|
|
14
|
+
- 不添加 Mock 框架或 API client。
|
|
15
|
+
- 交互可用 vitest + testing-library 验证。
|
|
16
|
+
|
|
17
|
+
## allowedPaths 建议
|
|
18
|
+
|
|
19
|
+
```text
|
|
20
|
+
src/widgets/Counter/**
|
|
21
|
+
test/widgets/Counter/**
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## expected verification 形态
|
|
25
|
+
|
|
26
|
+
- Static + behavior(本地交互)
|
|
27
|
+
- 无 mock-verify 节点
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# Frontend-implementation Eval 指标合同(M0)
|
|
2
|
+
|
|
3
|
+
状态:M0 冻结定义;M3 前部分指标仅定义不采集。
|
|
4
|
+
边界:**不包含 Browser / 视觉 / 真实页面启动**;Browser 相关一律记 `not-run` 或从分母排除(见下)。
|
|
5
|
+
|
|
6
|
+
## 通用规则
|
|
7
|
+
|
|
8
|
+
### 样本量
|
|
9
|
+
|
|
10
|
+
- **功能通过率类**:以选定 functional fixture 集为分母单元(每个 fixture × 每个 smoke target 记一次 trial,或按计划固定 trial 表)。
|
|
11
|
+
- **失败行为类**:以 failure fixture 集为单元;期望「正确阻断 / 正确分类」为成功,误放行为失败。
|
|
12
|
+
- **基线批次**:记录 `sampleSetId`、fixture 列表 hash、controller 版本、commit SHA。无记录则整批指标 `unavailable`。
|
|
13
|
+
|
|
14
|
+
### 缺失数据
|
|
15
|
+
|
|
16
|
+
| 符号 | 含义 |
|
|
17
|
+
|------|------|
|
|
18
|
+
| `N/A` | 能力尚未实现,指标定义保留但**禁止填 0** 伪装基线(例:M3 前 repair 后通过率) |
|
|
19
|
+
| `unavailable` | 实现已存在但本批 run 未记录分子或分母所需字段(例:无 token 账本) |
|
|
20
|
+
| `not-run` | 明确未执行的检查(例:Browser);不得计入「通过」 |
|
|
21
|
+
| `0` | 仅当分子与分母均有完整证据且分子确实为零 |
|
|
22
|
+
|
|
23
|
+
报告必须同时写出 **分子、分母、比率、样本量 n、缺失原因**。禁止只写百分比。
|
|
24
|
+
|
|
25
|
+
### 耗时 / token 来源
|
|
26
|
+
|
|
27
|
+
| 字段 | 来源(优先序) |
|
|
28
|
+
|------|----------------|
|
|
29
|
+
| 墙钟耗时 | DAG run 起止时间戳(run.json / harness run record);否则 shell `date` 外包测量 |
|
|
30
|
+
| 节点耗时 | 各 node start/end;缺失则节点级 `unavailable`,仅汇总 run 级 |
|
|
31
|
+
| token | executor / model usage 汇总(若 run 记录 `tokensUsed`);否则 `unavailable`,**不得估计** |
|
|
32
|
+
|
|
33
|
+
### Browser 边界
|
|
34
|
+
|
|
35
|
+
- 任何指标不得因「未跑浏览器」而扣分或加分。
|
|
36
|
+
- 不得将 Mock-backed 或 component test 记为 Browser pass。
|
|
37
|
+
- 指标表中 Browser 行固定 `not-run`(本计划范围内)。
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## 最低指标集
|
|
42
|
+
|
|
43
|
+
### 1. 首次静态通过率
|
|
44
|
+
|
|
45
|
+
- **名称**:`first_static_pass_rate`
|
|
46
|
+
- **分子**:第一次执行 `frontend-static-verify-shell` 即 exit 0 的 trial 数
|
|
47
|
+
- **分母**:完成到 static verify 的 trial 数(writer 已跑且 static 已调度)
|
|
48
|
+
- **排除**:DAG 在 writer 前被 Mock/design gate 阻断的 trial(记入 gate 阻断类,不进分母)
|
|
49
|
+
- **M0**:定义 + 手工/脚本采集方式;基线可 `unavailable` 直至有 fixture dogfood
|
|
50
|
+
|
|
51
|
+
### 2. 首次行为通过率
|
|
52
|
+
|
|
53
|
+
- **名称**:`first_behavior_pass_rate`
|
|
54
|
+
- **分子**:第一次执行 `frontend-behavior-verify-shell` 即 exit 0 的 trial 数
|
|
55
|
+
- **分母**:完成到 behavior verify 的 trial 数
|
|
56
|
+
- **说明**:行为通过不等于真实 API 联调;Mock-backed 仍可计入 behavior pass,但须另计「误报」指标
|
|
57
|
+
|
|
58
|
+
### 3. repair 后最终通过率
|
|
59
|
+
|
|
60
|
+
- **名称**:`post_repair_final_pass_rate`
|
|
61
|
+
- **分子**:在 ≤ max repair attempts 后 static+behavior+review gate 均通过的 trial 数
|
|
62
|
+
- **分母**:进入 repair 资格判定的 trial 数(repairable 失败)
|
|
63
|
+
- **M0–M2**:固定记 **`N/A`**(无 frontend repair runtime)
|
|
64
|
+
- **M3+**:按 failure taxonomy 采集
|
|
65
|
+
|
|
66
|
+
### 4. 需求追踪完整率
|
|
67
|
+
|
|
68
|
+
- **名称**:`requirement_trace_completeness_rate`
|
|
69
|
+
- **M0 分子**:`frontend-requirement-coverage-shell` 通过(或无显式 ID 时记 `not-applicable-trial`)且 closeout/plan 仍含全部绑定 ID 的 trial 数
|
|
70
|
+
- **M0 分母**:含显式 REQ/BR/AC 的 trial 数
|
|
71
|
+
- **语义**:M0 为 **identifier-presence**,不是文件/UI state 完整映射
|
|
72
|
+
- **M1+**:改为 validated contract 中每条 ID → target/state/test 映射完整率(届时更新本文件版本)
|
|
73
|
+
|
|
74
|
+
### 5. 越界写入次数
|
|
75
|
+
|
|
76
|
+
- **名称**:`forbidden_write_count`
|
|
77
|
+
- **分子**:write-guard / exclusive writeSet 拒绝次数 + review 确认的越界路径写入次数(按 trial 计数事件,可 >1)
|
|
78
|
+
- **分母**:含 writer 的 trial 数(用于率:`forbidden_write_rate = 分子/分母`)
|
|
79
|
+
- **期望基线**:治理应使成功 closeout 的 trial 分子为 0
|
|
80
|
+
|
|
81
|
+
### 6. 错误依赖次数
|
|
82
|
+
|
|
83
|
+
- **名称**:`unapproved_dependency_count`
|
|
84
|
+
- **分子**:未批准新增 dependency(package.json 变更未授权、review 标记 Important 等)事件数
|
|
85
|
+
- **分母**:含 writer 的 trial 数
|
|
86
|
+
- **采集**:diff 检查 + review findings 标签(需约定 finding code,M0 用人工标注)
|
|
87
|
+
|
|
88
|
+
### 7. Mock / 真实联调误报次数
|
|
89
|
+
|
|
90
|
+
- **名称**:`mock_real_integration_false_claim_count`
|
|
91
|
+
- **分子**:closeout 或报告将 Mock-backed 证据描述为真实 API 已联通,或省略 `Real integration: pending` 的 trial 数
|
|
92
|
+
- **分母**:`MOCK_STRATEGY` 为 native | browser-intercept | request-adapter 且无真实后端证据的 trial 数
|
|
93
|
+
- **期望**:0
|
|
94
|
+
|
|
95
|
+
### 8. 节点数 / 模型节点数
|
|
96
|
+
|
|
97
|
+
- **名称**:`node_count`, `model_node_count`
|
|
98
|
+
- **定义**:
|
|
99
|
+
- `node_count` = `spec.tasks.length`
|
|
100
|
+
- `model_node_count` = `executor === "pi"`(或非 shell/static)的节点数
|
|
101
|
+
- **报告**:按 topology 变体分别记录(standard / +coverage / +mock-verify / blocked)
|
|
102
|
+
- **M0 基线参考(standard 无 optional)**:`node_count=16`;模型节点含 contract/scout/mock-assess/plan/design/plan-revision/final-design-review/implement/review/closeout(以 builder 为准,测试锁定 id 列表)
|
|
103
|
+
|
|
104
|
+
### 9. 墙钟耗时
|
|
105
|
+
|
|
106
|
+
- **名称**:`wall_clock_ms`
|
|
107
|
+
- **分子/分母**:不适用;报告 **p50 / p95 / max** 与 **n**
|
|
108
|
+
- **来源**:见通用规则;缺失 → `unavailable`
|
|
109
|
+
|
|
110
|
+
### 10. Token
|
|
111
|
+
|
|
112
|
+
- **名称**:`tokens_total`
|
|
113
|
+
- **报告**:sum 与 per-role breakdown(若可得);缺失 → `unavailable`
|
|
114
|
+
- **禁止**:用字符数或经验公式估算后当作实测
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## 建议采集表头(CSV / Markdown)
|
|
119
|
+
|
|
120
|
+
```text
|
|
121
|
+
sampleSetId, trialId, fixtureId, targetId, controllerVersion, commitSha,
|
|
122
|
+
topologyVariant, mockStrategy,
|
|
123
|
+
first_static_pass (0|1|unavailable),
|
|
124
|
+
first_behavior_pass (0|1|unavailable),
|
|
125
|
+
post_repair_final_pass (0|1|N/A|unavailable),
|
|
126
|
+
requirement_trace_ok (0|1|not-applicable|unavailable),
|
|
127
|
+
forbidden_write_count,
|
|
128
|
+
unapproved_dependency_count,
|
|
129
|
+
mock_real_false_claim (0|1|n/a),
|
|
130
|
+
node_count, model_node_count,
|
|
131
|
+
wall_clock_ms, tokens_total,
|
|
132
|
+
browser_status (not-run)
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## 与 M1+ 的关系
|
|
136
|
+
|
|
137
|
+
- 指标名称稳定;分子定义可在 M1(contract)、M3(repair)版本化增补,须在 CHANGELOG/本文件注明 **metrics schema version**。
|
|
138
|
+
- 当前 **metrics schema version: m0.1**。
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Frontend-implementation Smoke Targets 策略(M0)
|
|
2
|
+
|
|
3
|
+
## 原则
|
|
4
|
+
|
|
5
|
+
1. **仅使用平台临时目录**(`os.tmpdir()` / CI runner temp),**不得**在 loop-agent 仓库根写入可运行 app、`node_modules` 或构建产物。
|
|
6
|
+
2. **不启动浏览器**;不安装 Playwright/Cypress;不声明 Browser verification。
|
|
7
|
+
3. M0 只冻结**目标描述与生成约定**;真正从 fixture 物化临时项目在 **M1+ dogfood** 时实施。
|
|
8
|
+
4. 临时项目生命周期:创建 → 最小依赖安装(仅 temp)→ 跑冻结 static/behavior 命令 → 删除;失败日志可复制到 run-owned harness 目录,不进 git。
|
|
9
|
+
|
|
10
|
+
## 三类可控目标
|
|
11
|
+
|
|
12
|
+
| targetId | 栈 | 最小信号 | 建议 static | 建议 behavior | Browser |
|
|
13
|
+
|----------|----|----------|-------------|---------------|---------|
|
|
14
|
+
| `react-vitest-min` | React + Vitest + TypeScript | `package.json` scripts: `typecheck`, `build`/`vite build`, `test`;`src/**/*.tsx` | `npm run typecheck`(+ build 若存在) | `npm test` / `npx vitest run` | not-run |
|
|
15
|
+
| `nextjs-min` | Next.js(App Router 信号) | `app/` 或 `pages/` + `"next"` dependency;`"use client"` 边界样例 | `npm run typecheck` / `next build`(temp only) | 聚焦 unit/component test,**不** `next start` 作完成证据 | not-run |
|
|
16
|
+
| `vue-vitest-min` | Vue 3 + Vitest | `*.vue` + vitest config | `npm run typecheck` 或 `vue-tsc` | `npm test` | not-run |
|
|
17
|
+
|
|
18
|
+
## 临时项目生成约定(M1+ 实施)
|
|
19
|
+
|
|
20
|
+
```text
|
|
21
|
+
ROOT="$(mktemp -d "${TMPDIR:-/tmp}/fe-eval-XXXXXX")"
|
|
22
|
+
# 从 docs/templates/frontend-eval/fixtures/... 渲染 package.json / 源文件骨架
|
|
23
|
+
# npm install --prefix "$ROOT" # 仅 temp
|
|
24
|
+
# 在 $ROOT 执行冻结 verify 命令
|
|
25
|
+
# rm -rf "$ROOT"
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
约束:
|
|
29
|
+
|
|
30
|
+
- fixture **不得**内嵌密钥、真实 PII、恶意脚本。
|
|
31
|
+
- 依赖版本钉死在 fixture 清单,避免 eval 漂移。
|
|
32
|
+
- 不得 `npm link` 工作区 loop-agent 作为被测 app 依赖(controller 版本另按任务约束)。
|
|
33
|
+
|
|
34
|
+
## 与 functional / failure fixtures 映射
|
|
35
|
+
|
|
36
|
+
| fixture 类别 | 优先 target |
|
|
37
|
+
|--------------|-------------|
|
|
38
|
+
| simple component / style | react-vitest-min, vue-vitest-min |
|
|
39
|
+
| form validation | react-vitest-min |
|
|
40
|
+
| list/detail | react-vitest-min, nextjs-min |
|
|
41
|
+
| API + Mock | react-vitest-min(+ MSW 骨架) |
|
|
42
|
+
| permission UI | react-vitest-min, nextjs-min |
|
|
43
|
+
| SSR / server-client boundary | nextjs-min |
|
|
44
|
+
| shared component API | react-vitest-min |
|
|
45
|
+
| pure local no-remote | 任一 |
|
|
46
|
+
| failure: type/build | 任一 |
|
|
47
|
+
| failure: mock production-on | react-vitest-min + mock 骨架 |
|
|
48
|
+
|
|
49
|
+
## 明确不做
|
|
50
|
+
|
|
51
|
+
- 不在本仓库 `website/**` 或 examples 中落永久 dogfood app 作为 M0 必需项。
|
|
52
|
+
- 不把 `scripts/check-repo.sh` 全量当作前端 app 验证。
|
|
53
|
+
- 不提交 temp 安装树或截图基线。
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "frontend-implementation-contract-v1",
|
|
4
|
+
"title": "Frontend Implementation Contract v1",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["schemaVersion", "sourceBinding", "riskLevel", "targets", "requirements", "uiStates", "interactions", "mockApi", "designEvidence", "verificationTargets", "evidenceGaps"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"schemaVersion": { "const": 1 },
|
|
10
|
+
"sourceBinding": { "$ref": "#/$defs/sourceBinding" },
|
|
11
|
+
"riskLevel": { "enum": ["small", "standard", "high-risk"] },
|
|
12
|
+
"targets": { "type": "object", "additionalProperties": false, "required": ["files"], "properties": { "files": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/path" } }, "routes": { "type": "array", "items": { "type": "string", "pattern": "^/" } }, "publicApiChanges": { "type": "array", "items": { "type": "string", "minLength": 1 } } } },
|
|
13
|
+
"requirements": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["id", "implementationTargets", "verificationTargetIds"], "properties": { "id": { "$ref": "#/$defs/requirementId" }, "implementationTargets": { "type": "array", "items": { "$ref": "#/$defs/path" } }, "verificationTargetIds": { "type": "array", "items": { "type": "string", "minLength": 1 } }, "evidenceGap": { "$ref": "#/$defs/gap" } } } },
|
|
14
|
+
"uiStates": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["name", "applicable"], "properties": { "name": { "type": "string", "minLength": 1 }, "applicable": { "type": "boolean" }, "expectedBehavior": { "type": "string", "minLength": 1 }, "implementationTargets": { "type": "array", "items": { "$ref": "#/$defs/path" } }, "verificationTargetIds": { "type": "array", "items": { "type": "string", "minLength": 1 } }, "notApplicableReason": { "type": "string", "minLength": 1 } } } },
|
|
15
|
+
"interactions": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["name", "implementationTargets", "verificationTargetIds"], "properties": { "name": { "type": "string", "minLength": 1 }, "implementationTargets": { "type": "array", "items": { "$ref": "#/$defs/path" } }, "verificationTargetIds": { "type": "array", "items": { "type": "string" } } } } },
|
|
16
|
+
"mockApi": { "type": "object", "additionalProperties": false, "required": ["strategy", "productionDefaultOff", "activation", "endpoints"], "properties": { "strategy": { "enum": ["native", "browser-intercept", "request-adapter", "not-needed"] }, "productionDefaultOff": { "const": true }, "activation": { "type": "string", "minLength": 1 }, "endpoints": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["method", "path"], "properties": { "method": { "enum": ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"] }, "path": { "type": "string", "pattern": "^/" }, "fixture": { "$ref": "#/$defs/path" }, "consumer": { "$ref": "#/$defs/path" } } } } } },
|
|
17
|
+
"designEvidence": { "type": "object", "additionalProperties": false, "required": ["source", "paths", "conflicts"], "properties": { "source": { "type": "string", "minLength": 1 }, "paths": { "type": "array", "items": { "$ref": "#/$defs/path" } }, "conflicts": { "type": "array", "items": { "type": "string", "minLength": 1 } } } },
|
|
18
|
+
"verificationTargets": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": ["id", "type", "commandLabel", "file", "requirementIds", "uiStates"], "properties": { "id": { "type": "string", "minLength": 1 }, "type": { "enum": ["static", "unit", "component", "integration", "mock"] }, "commandLabel": { "type": "string", "minLength": 1 }, "file": { "$ref": "#/$defs/path" }, "symbol": { "type": "string", "minLength": 1 }, "requirementIds": { "type": "array", "items": { "$ref": "#/$defs/requirementId" } }, "uiStates": { "type": "array", "items": { "type": "string", "minLength": 1 } } } } },
|
|
19
|
+
"evidenceGaps": { "type": "array", "items": { "$ref": "#/$defs/gap" } }
|
|
20
|
+
},
|
|
21
|
+
"$defs": {
|
|
22
|
+
"path": { "type": "string", "minLength": 1, "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*\\\\).+$" },
|
|
23
|
+
"requirementId": { "type": "string", "pattern": "^(?:REQ|BR|AC)-[A-Z0-9]+(?:-[A-Z0-9]+)*$" },
|
|
24
|
+
"gap": { "type": "object", "additionalProperties": false, "required": ["description", "blocking"], "properties": { "requirementId": { "$ref": "#/$defs/requirementId" }, "description": { "type": "string", "minLength": 1 }, "blocking": { "type": "boolean" } } },
|
|
25
|
+
"sourceBinding": { "type": "object", "additionalProperties": false, "required": ["taskId", "requirementPath", "requirementSha256", "referencePaths", "requirementIds"], "properties": { "taskId": { "type": "string", "minLength": 1 }, "requirementPath": { "$ref": "#/$defs/path" }, "requirementSha256": { "type": "string", "pattern": "^[a-f0-9]{64}$" }, "referencePaths": { "type": "array", "items": { "$ref": "#/$defs/path" } }, "requirementIds": { "type": "array", "items": { "$ref": "#/$defs/requirementId" } } } }
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -16,6 +16,16 @@ TODO
|
|
|
16
16
|
|
|
17
17
|
TODO
|
|
18
18
|
|
|
19
|
+
## Mock 约束(数据型任务)
|
|
20
|
+
|
|
21
|
+
- Mock/API/schema 规范路径:TODO
|
|
22
|
+
- 既有 Mock service root、handler/fixture/bootstrap:TODO
|
|
23
|
+
- 既有 browser/e2e interception 或 request adapter/DI seam:TODO
|
|
24
|
+
- 启动、健康检查和专项验证命令:TODO
|
|
25
|
+
- production 禁用边界:TODO
|
|
26
|
+
- 真实请求默认路径与 Mock 显式启用方式:TODO
|
|
27
|
+
- `task.json.frontendMock.policy`:`auto | required | disabled`
|
|
28
|
+
|
|
19
29
|
## allowedPaths
|
|
20
30
|
|
|
21
31
|
TODO
|
|
@@ -52,6 +52,15 @@ TODO
|
|
|
52
52
|
|
|
53
53
|
TODO
|
|
54
54
|
|
|
55
|
+
## 接口与 Mock 输入
|
|
56
|
+
|
|
57
|
+
- 接口文档/schema:TODO
|
|
58
|
+
- endpoint、method、关键请求/响应字段:TODO
|
|
59
|
+
- 是否允许依赖真实后端:TODO
|
|
60
|
+
- 是否要求离线或独立行为验证:TODO
|
|
61
|
+
- success/empty/error/permission 状态:TODO
|
|
62
|
+
- 后端当前就绪状态与 Real Integration Gap:TODO
|
|
63
|
+
|
|
55
64
|
## 验收标准
|
|
56
65
|
|
|
57
66
|
TODO
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Generate frontend functional cases
|
|
2
|
+
|
|
3
|
+
Use `playwright-cli-case-generator`. Read only `testcase/frontend/rag/context.md`, `coverage-map.md`, and existing `testcase/frontend/cases/`; write only that cases directory. Produce Markdown cases, `index.md`, and schema-version-1 `manifest.json`. Do not generate pytest or Playwright source code.
|
|
4
|
+
|
|
5
|
+
Each case is independently executable and includes AC mapping, preconditions, session, cleanup, UI assertions, and isolated evidence paths. Use dimensions `core`, `boundary`, `flow`, or `backend`. Never guess API fields, constraints, SLA, credentials, or unrecorded data. The open command is exactly `playwright-cli open --browser=chrome --headed <base-url>`.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "./agent-dag.schema.json",
|
|
3
|
+
"version": 3,
|
|
4
|
+
"title": "Frontend test RAG DAG template",
|
|
5
|
+
"runtimeContract": { "schemaVersion": 1, "agentRuntime": "pi-only", "repairWriterProtocol": "explicit-node-v1" },
|
|
6
|
+
"objective": "Build a frontend test RAG package, generate Markdown cases, execute each case serially through playwright-cli, and retain browser evidence.",
|
|
7
|
+
"globalConstraints": [
|
|
8
|
+
"Do not generate pytest or Playwright source code.",
|
|
9
|
+
"Only use declared isolated test environments; production URLs and real credentials are blocked.",
|
|
10
|
+
"Every generated browser start command is playwright-cli open --browser=chrome --headed <base-url>.",
|
|
11
|
+
"Case children execute serially. Persist each case result, logs and browser evidence before the next child starts.",
|
|
12
|
+
"A token threshold is a post-case stop check, not a model hard token cap; unstarted cases must be recorded as blocked: token-budget-exhausted."
|
|
13
|
+
],
|
|
14
|
+
"tasks": [
|
|
15
|
+
{ "id": "retrieve-frontend-test-context-pi", "depends_on": [], "executor": "pi", "role": "planner", "toolProfile": "write", "complexity": "HIGH", "writePolicy": "exclusive", "writeSet": ["testcase/frontend/rag/**"], "allowedPaths": ["REPLACE/WITH/SOURCE/PATH/**", "testcase/frontend/rag/**"], "forbiddenPaths": [".harness/**", "artifacts/**"], "outputContract": "RAG context.md and coverage-map.md.", "subtask_prompt_markdown": "./frontend-test-dag.retrieve-context.prompt.md" },
|
|
16
|
+
{ "id": "generate-frontend-functional-cases-pi", "depends_on": ["retrieve-frontend-test-context-pi"], "executor": "pi", "role": "implementer", "toolProfile": "write", "complexity": "HIGH", "writePolicy": "exclusive", "writeSet": ["testcase/frontend/cases/**"], "allowedPaths": ["testcase/frontend/rag/**", "testcase/frontend/cases/**"], "forbiddenPaths": [".harness/**", "artifacts/**"], "outputContract": "Markdown cases, index.md and manifest.json schemaVersion 1; no test source code.", "subtask_prompt_markdown": "./frontend-test-dag.generate-cases.prompt.md" },
|
|
17
|
+
{ "id": "review-frontend-cases-pi", "depends_on": ["generate-frontend-functional-cases-pi"], "executor": "pi", "role": "reviewer", "complexity": "HIGH", "writePolicy": "read-only", "allowedPaths": ["testcase/frontend/rag/**", "testcase/frontend/cases/**"], "forbiddenPaths": [".harness/**", "artifacts/**"], "outputContract": "First line VERDICT: pass or VERDICT: request-revision; no writes.", "subtask_prompt_markdown": "./frontend-test-dag.review-cases.prompt.md" },
|
|
18
|
+
{ "id": "materialize-frontend-case-manifest-shell", "depends_on": ["review-frontend-cases-pi"], "executor": "shell", "role": "verifier", "complexity": "LOW", "writePolicy": "read-only", "allowedPaths": ["testcase/frontend/cases/**"], "forbiddenPaths": [".harness/**", "artifacts/**"], "outputContract": "stdout exactly JSON { cases: [...] } after manifest validation.", "subtask_prompt": "Validate the generated frontend case manifest." },
|
|
19
|
+
{ "id": "execute-frontend-cases-map", "depends_on": ["materialize-frontend-case-manifest-shell"], "executor": "static", "role": "verifier", "complexity": "LOW", "writePolicy": "none", "allowedPaths": [], "forbiddenPaths": [".harness/**", "artifacts/**"], "outputContract": "Serial aggregate of browser case results.", "subtask_prompt": "Expand the validated manifest into serial browser case children.", "static": { "resultMarkdown": "Frontend case map expansion barrier." }, "dynamicExpansion": { "type": "map_agent", "workflowNodeId": "execute-frontend-cases-map", "itemsFrom": "$.nodes['materialize-frontend-case-manifest-shell'].output.cases", "itemName": "case", "maxItems": 20, "maxExpandedNodes": 20, "childIdPrefix": "execute-frontend-case", "tokenBudget": { "maxTokensPerCase": 20000, "maxTotalTokens": 200000 }, "childTask": { "executor": "pi", "role": "verifier", "skills": ["playwright-cli", "webapp-testing"], "toolProfile": "write", "complexity": "MED", "subtaskPromptTemplate": "Execute {{case.caseId}} from {{case.casePath}} in a fresh Pi session. Use playwright-cli open --browser=chrome --headed <base-url>. Persist result, logs and screenshots/trace/video under {{case.evidenceDir}}; return compact JSON only.", "outputContract": "Compact JSON <=1200 chars.", "writePolicy": "exclusive", "allowedPaths": ["testcase/frontend/cases/{{case.caseId}}.md", "testcase/frontend/rag/context.md", "testcase/frontend/rag/coverage-map.md", "testcase/frontend/evidence/{{case.caseId}}/**"], "forbiddenPaths": [".harness/**", "artifacts/**"], "writeSet": ["testcase/frontend/evidence/{{case.caseId}}/**"] } } },
|
|
20
|
+
{ "id": "review-frontend-execution-pi", "depends_on": ["execute-frontend-cases-map"], "executor": "pi", "role": "reviewer", "complexity": "HIGH", "writePolicy": "read-only", "allowedPaths": ["testcase/frontend/**"], "forbiddenPaths": [".harness/**", "artifacts/**"], "outputContract": "AC-to-case-to-browser-evidence review.", "subtask_prompt_markdown": "./frontend-test-dag.review-execution.prompt.md" },
|
|
21
|
+
{ "id": "frontend-test-retrospect-pi", "depends_on": ["review-frontend-execution-pi"], "executor": "pi", "role": "closeout", "toolProfile": "write", "complexity": "MED", "writePolicy": "exclusive", "writeSet": ["docs/test-reports/**"], "allowedPaths": ["testcase/frontend/**", "docs/test-reports/**"], "forbiddenPaths": [".harness/**", "artifacts/**"], "outputContract": "Frontend test retrospective with A/B/C/D rating.", "subtask_prompt_markdown": "./frontend-test-dag.retrospect.prompt.md" }
|
|
22
|
+
]
|
|
23
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
# Retrieve frontend test context
|
|
2
|
+
|
|
3
|
+
Write only `testcase/frontend/rag/context.md` and `coverage-map.md`. Record traceable facts from the task source, routes, components, API/Mock contracts, existing tests and execution contract. Do not invent fields, credentials, limits or test data.
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
# Review frontend cases
|
|
2
|
+
|
|
3
|
+
Read the RAG files and Markdown cases only. First line must be `VERDICT: pass` or `VERDICT: request-revision`. Report AC coverage, case independence, evidence completeness, unsafe environment/data dependencies, and manifest issues. The verdict is advisory and does not block browser execution.
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
# Review frontend execution evidence
|
|
2
|
+
|
|
3
|
+
Review AC → case → browser-evidence traceability. A passed case needs assertions and screenshot or equivalent browser evidence. Failed and blocked cases need an explicit cause. Treat `token-budget-exhausted` as blocked; do not substitute model conclusions or static checks for browser evidence.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"inventory writes knowledge/bootstrap/inventory.json",
|
|
9
9
|
"propose-pi writes only knowledge/bootstrap/staging/** with evidence and non-asserted confidence",
|
|
10
10
|
"validate-shell fails on empty staging, missing edges.proposed/coverage-notes, or self-asserted confidence",
|
|
11
|
-
"
|
|
11
|
+
"multi-perspective review (structure/evidence/safety) each emit VERDICT; aggregate gate requires all pass before promote",
|
|
12
12
|
"promote merges new formal files only (no overwrite)",
|
|
13
13
|
"materialize writes knowledge/graph/entities-index.yaml and edges.yaml"
|
|
14
14
|
],
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
"knowledge-sync-collect-pi inventories final verification evidence, ACs, cases, and defect candidates without writing files",
|
|
8
8
|
"knowledge-sync-draft-pi writes schemaVersion 1 knowledge-sync-draft.json under features/<feature-id>/testing/sync/pending/",
|
|
9
9
|
"knowledge-sync-validate-shell fails closed on missing draft, invalid schema, or non-pass finalVerification when gated",
|
|
10
|
+
"multi-perspective review (qa/domain/evidence) each emit VERDICT; aggregate gate requires all pass before apply",
|
|
10
11
|
"knowledge-sync-apply-pi upserts acceptance-verdict, coverage-matrix, cases, automation-map, and defects only within writeSet",
|
|
11
12
|
"knowledge-sync-pointer-pi writes runs/latest.md and sync/applied/KS-*.json audit pointers",
|
|
12
13
|
"No writes to src/**, .harness/**, or knowledge/testing/standards/**"
|
|
@@ -18,6 +18,9 @@
|
|
|
18
18
|
| Versioned self-hosting candidate canary | `npx vitest run test/self-host-canary.test.ts test/package-surface.test.ts` + `npm run build` | `npm run self-host:canary -- --deterministic --output <evidence.json>` + `npm pack --dry-run` |
|
|
19
19
|
| Public skill / init mirror surface | `bash scripts/check-skill-entry.sh` + `npx vitest run test/init-command.test.ts test/package-surface.test.ts` | 临时目标项目 full init + skill/mirror hash 对照 + `bash scripts/check-repo.sh` |
|
|
20
20
|
| DAG 工作流 | 定向 DAG 测试 | `npm test` |
|
|
21
|
+
| Eval Replay MVP | `npx vitest run test/eval-replay.test.ts test/eval-cli.test.ts test/cli-contract.test.ts` + `npm run typecheck` | `bash scripts/check-command-registry-drift.sh` + `bash scripts/check-architecture-boundaries.sh` + `node bin/loop-agent.js eval --help` + `bash scripts/check-repo.sh` |
|
|
22
|
+
| Eval Candidate Registry MVP | `npx vitest run test/eval-candidate-registry.test.ts test/eval-cli.test.ts test/cli-contract.test.ts` + `npm run typecheck` | `npm run build` + `bash scripts/check-command-registry-drift.sh` + `bash scripts/check-architecture-boundaries.sh` + `node bin/loop-agent.js eval --help` + `HARNESS_ALLOW_ACTIVE_DAG_RUNS=1 bash scripts/check-repo.sh` |
|
|
23
|
+
| Eval run association W2.3 | `npx vitest run test/eval-run-association.test.ts test/eval-replay.test.ts test/dag-report.test.ts test/run-dag.test.ts` + `npm run typecheck` | `npm run build` + `bash scripts/check-architecture-boundaries.sh` + `bash scripts/check-command-registry-drift.sh` + `HARNESS_ALLOW_ACTIVE_DAG_RUNS=1 bash scripts/check-repo.sh` + `npm run docs:build` + `git diff --check` |
|
|
21
24
|
| 前端 DAG 模板 / 前端节点生成 | `npm run typecheck` + 定向 DAG 测试 | `npm test` + `bash scripts/check-repo.sh` |
|
|
22
25
|
| Production readiness hardening | `bash scripts/check-repo.sh` + 定向 DAG/CLI 测试 | `bash scripts/ci.sh` + docs build + package smoke |
|
|
23
26
|
| 脚本或 CI | 运行变更的脚本 | `bash scripts/ci.sh` |
|
|
@@ -56,7 +59,7 @@ Windows 上通过 Git Bash 或已配置的兼容 Bash 运行 `scripts/*.sh`。
|
|
|
56
59
|
|
|
57
60
|
没有相关门禁的新鲜命令输出,不得声明完成。
|
|
58
61
|
|
|
59
|
-
Production Readiness v0.1 工作以 `
|
|
62
|
+
Production Readiness v0.1 工作以 `ai_workspace/loop-agent/production-readiness.md` 与 `ai_workspace/loop-agent/templates/production-readiness-checklist.md` 为验收契约。最终 hardening closeout 需要:
|
|
60
63
|
|
|
61
64
|
```bash
|
|
62
65
|
bash scripts/ci.sh
|