一键导入
forge-eval-gate
WHEN: Implementation is complete and PRs are ready to merge. HARD-GATE: Nothing merges without eval passing. E2E product eval is the final gate.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
WHEN: Implementation is complete and PRs are ready to merge. HARD-GATE: Nothing merges without eval passing. E2E product eval is the final gate.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
WHEN: You need to detect performance regressions before merge — TTFB, response time, bundle size. Run as part of forge-eval-gate or standalone before raising a PR.
WHEN: A decision is being superseded, deprecated, or has aged out. Archive it without deletion — marks as warm→cold→archived with full audit trail.
WHEN: You are writing a new decision, superseding an old one, or querying relationships across decisions. Create semantic edges between decisions and link concepts across products/projects/time.
WHEN: You are about to make a decision and need to check if prior art or past learnings exist. Recall decisions, patterns, and gotchas from the brain before proceeding.
WHEN: You need to trace the full provenance of a specific decision — who made it, when, why, and what alternatives were considered. Shows why, when, by whom, evidence, alternatives, outcome.
WHEN: You need to record a decision, lock a spec, log an eval run, or document learnings in the brain.
| name | forge-eval-gate |
| description | WHEN: Implementation is complete and PRs are ready to merge. HARD-GATE: Nothing merges without eval passing. E2E product eval is the final gate. |
| type | rigid |
| version | 1.0.7 |
| preamble-tier | 4 |
| triggers | ["eval gate","nothing merges without eval","check eval before merge"] |
| allowed-tools | ["Bash"] |
Rule: No feature ships without e2e eval passing.
| Rationalization | The Truth |
|---|---|
| "Unit tests all pass, we don't need e2e eval" | Unit tests verify components in isolation. Eval tests integration, real services, real conditions. Different gates, not redundant. |
| "Eval is slow, we can test manually" | Manual testing is incomplete (you can't test all paths) and unrepeatable (tomorrow it might fail). Eval is the only source of truth. |
| "The code review was thorough, eval is redundant" | Code review is static analysis. Eval is dynamic behavior. A reviewed function can fail at runtime due to environment, concurrency, state. |
| "We've deployed similar features before, eval isn't needed" | Similar != identical. Dependencies changed, services upgraded, scale increased. Every feature needs eval. |
| "The 3-retry limit is too strict, we should allow more retries" | 3 retries is not a limitation, it's a signal. If eval fails after 3 attempts, the feature is broken, not the eval. Fix the feature. |
| "This is just a config change, it doesn't need full eval" | Config changes affect all downstream consumers. Eval catches config mismatches that code review never will. |
| "We can defer eval to post-merge, do it in staging" | Once merged, the bug is in main. Eval is pre-merge only. Post-merge eval is incident response, not quality control. |
| "Conductor / agent stopped after implement or review — eval was never run" | Orchestration is incomplete. conductor-orchestrate must enter P4.4 (eval-product-stack-up + drivers) after reviews unless the human logs an explicit task ABORT. Partial runs are not shippable. |
| "We skipped machine-eval CSV and went straight to implementation" | Invalid orchestration unless qa/semantic-eval-manifest.json + [P4.0-SEMANTIC-EVAL] satisfies machine eval (see docs/forge-task-verification.md). When kind is semantic-csv-eval, qa/semantic-automation.csv must exist and parse (docs/semantic-eval-csv.md). No machine-eval artifact → P4.4 has nothing faithful to run. CI: tools/verify_forge_task.py enforces a valid manifest (and CSV when required). |
| "We led the session with a blocking interactive prompt about a downstream gate before upstream prerequisites existed" | Inverted order — violates using-forge Stage-local questioning. Examples: eval/CSV waiver before prd-locked or qa-analysis; merge strategy before council; tech-plan approval before plans exist. Fix the first missing prerequisite for the current phase only. State 4b (qa-prd-analysis → manual-test-cases.csv where required → qa-semantic-csv-orchestrate) applies to the QA→machine-eval slice. |
| "Eval passed but nobody checked against approved QA CSV" | When forge_qa_csv_before_eval: true, GREEN eval should exercise the same journeys as qa/manual-test-cases.csv (TraceToCsvId / intent alignment in semantic-automation.csv). Otherwise “passing eval” is not proof the signed acceptance set ran. |
| "The performance test results look good from the code, we don't need eval" | Code metrics don't equal runtime behavior. Network latency, contention, GC pauses all appear at runtime, not in code. |
| "Eval caught a flaky test, we can just remove the flaky test" | A flaky test is a symptom of real behavior. Removing the test hides the problem. Fix the underlying flakiness. |
| "This change doesn't touch user flows, eval isn't critical" | Internal changes affect reliability. All changes affect user experience eventually (latency, availability, correctness). Eval all. |
| "Eval is GREEN so layout must match Figma" | Default eval drivers are behavior-first. design_new_work: yes tasks still need design parity (design-implementation-reviewer / figma-design-sync in conductor P4.2, or human visual sign-off when the harness has no design subagent). Do not treat API-green as pixel-perfect. |
NOTHING MERGES WITHOUT EVAL PASSING. A PASSING TEST SUITE IS NOT A PASSING EVAL. EVAL IS THE ONLY PROOF THE SYSTEM WORKS END-TO-END.
If you notice any of these, STOP and do not proceed:
[P4.1-DISPATCH] appears in logs without [P4.0-SEMANTIC-EVAL] — No machine-eval artifact was recorded. STOP. Back up to qa-semantic-csv-orchestrate / docs/semantic-eval-csv.md; do not treat the task as shippable.[P4.4-EVAL-PASS] is logged before the eval driver finishes running — Markers must reflect actual, completed state — not anticipated state. Logging the eval-pass marker optimistically (before semantic-eval-manifest.json is written with outcome: pass) means the audit trail is false. STOP. The sequence is strictly: eval driver completes → semantic-eval-manifest.json written with outcome: pass → semantic-eval-run.log complete → THEN log [P4.4-EVAL-PASS] to conductor.log. Any other order is invalid.qa/manual-test-cases.csv when policy requiresqa/semantic-automation.csv covers critical journeys; TraceToCsvId may link steps to manual CSV Id rows
qa/manual-test-cases.csv exists):
semantic-automation.csv step (via TraceToCsvId or documented mapping) covers that journeyX/Y approved journeys covered by semantic automation~/forge/brain/prds/<task-id>/qa/qa/semantic-automation.csv + execution plan per docs/semantic-eval-csv.md/eval-product-stack-up (reads forge-product.yaml)
qa/semantic-automation.csvqa-semantic-csv-orchestrate / tools/run_semantic_csv_eval.py; host maps Surface to drivers (eval-driver-web-cdp, eval-driver-api-http, eval-driver-db-mysql, eval-driver-cache-redis, eval-driver-bus-kafka, eval-driver-search-es, eval-driver-android-adb, eval-driver-ios-xctest per D5)
qa/semantic-eval-manifest.json + qa/semantic-eval-run.log; log [P4.0-SEMANTIC-EVAL] when State 4b authoring completesYELLOW means non-critical failures detected. Do not treat YELLOW as GREEN.
For each YELLOW scenario:
~/forge/brain/prds/<task-id>/eval/yellow-triage-<YYYYMMDD>.mdWhen a scenario fails with a connectivity or infrastructure error (not an assertion failure), classify as RED_INFRA before entering the self-heal loop:
RED_INFRA symptoms:
RED_INFRA vs RED_PRODUCT decision:
| Signal | Classification |
|---|---|
| Connection refused on the product's own port | RED_PRODUCT — product failed to start |
| Connection refused on a dependency (DB, broker) | RED_INFRA — infrastructure failed |
| Assertion fails on valid input | RED_PRODUCT — product returned wrong value |
| Eval driver itself crashes (segfault, OOM) | RED_INFRA — driver issue |
HARD-GATE: Do NOT consume self-heal attempts on RED_INFRA. Self-heal is for product bugs, not infrastructure. Instead:
[EVAL-INFRA] task_id=<id> component=<name> error=<summary> timestamp=<ISO8601>IF any scenario fails:
/self-heal-locate-fault to identify which service failed
/self-heal-triage to classify the failure
Attempt 1:
Attempt 2:
/self-heal-systematic-debug (4-phase debugging)
Attempt 3:
After all scenarios complete, compute a 0-10 ship-readiness score:
python3 -c "
total = <total_scenarios>
passed = <passed_count>
yellow = <yellow_count>
failed = <failed_count>
manual_skipped = <manual_skipped_count>
# Weight: failed = -1.5pt, yellow = -0.5pt, manual_skipped = -0.25pt per scenario
score = 10.0
if total > 0:
score -= (failed / total) * 10 * 1.5
score -= (yellow / total) * 10 * 0.5
score -= (manual_skipped / total) * 10 * 0.25
score = max(0.0, min(10.0, round(score, 1)))
tier = 'GREEN' if score >= 8.0 else 'YELLOW' if score >= 5.0 else 'RED'
print(f'Ship-readiness: {score}/10 ({tier})')
print(f' Passed: {passed} | Yellow: {yellow} | Failed: {failed} | Skipped: {manual_skipped}')
if tier == 'RED':
print(' Action: Do not merge. Fix failing scenarios.')
elif tier == 'YELLOW':
print(' Action: Investigate yellow scenarios before merging.')
else:
print(' Action: Safe to proceed to PR.')
"
Score tiers:
Write the score to brain alongside the eval results:
# Append to existing eval result file:
echo "ship_readiness_score: <score>" >> "$EVAL_RESULT_FILE"
echo "ship_readiness_tier: <tier>" >> "$EVAL_RESULT_FILE"
EVAL PASS
- All X scenarios passed end-to-end
- All services healthy throughout eval
- Critical paths verified: [list]
- Edge cases tested: [list]
- Performance within SLA: [metrics]
Evidence: [link to eval output logs]
Ready for merge.
Before merging, verify:
Situation: Cannot run eval because supporting infrastructure is down (Kafka broker, test runner, database service).
Example: "Docker daemon not running" or "Cannot connect to Redis" or "CI/CD pipeline agent offline"
Do NOT: Claim eval pass because "it should work if infrastructure was up"
Action:
Situation: All scenarios technically pass, but output contains warnings (test ran twice to pass, timeouts, deprecation warnings, known flakiness).
Example: "Scenario passed on retry after 3s timeout" or "Test passed but took 35s, SLA is 30s"
Do NOT: Treat YELLOW (warnings) as GREEN (clean pass)
Action:
Situation: Eval scenarios hang or timeout before completion (> 60 min total runtime).
Example: "Test scenario deadlocked waiting for response" or "Performance test still running after 90 minutes"
Do NOT: Increase timeout limits to make eval pass. Long timeouts hide real bugs (deadlocks, infinite loops, incorrect waits).
Action:
/self-heal-locate-fault to identify hanging service/scenarioPartial result preservation (HARD-GATE): Before killing a hanging eval, capture completed scenario results so re-runs don't start from scratch:
# Capture completed scenarios from semantic-eval-run.log before killing
grep '"outcome": "PASS"' qa/semantic-eval-run.log | \
python3 -c "import sys,json; [print(json.loads(l)['stepId']) for l in sys.stdin]" \
> qa/semantic-eval-completed-steps.txt
echo "Completed $(wc -l < qa/semantic-eval-completed-steps.txt) steps before timeout"
On re-run, the driver should skip steps listed in semantic-eval-completed-steps.txt (pass-through with prior PASS result). If the driver does not support resume, note the count so the re-run progress is tracked. Do NOT re-run 100 scenarios when 80 passed — document and re-run only the TIMED_OUT remainder.
Output: EVAL PASS (ready to merge) or DONE_WITH_CONCERNS (passes with warnings, must be documented) or BLOCKED (eval failing after 3 retries, infrastructure down, scale/perf infeasible, eval hangs)
Symptom: Eval fails on run 1 with a timing assertion or connection error, passes on run 2 with no code change. Dreamer wants to treat this as a pass.
Do NOT: Accept a retry pass as evidence of correctness. A pass on retry after an unexplained first-run failure is evidence of flakiness, not correctness.
Action:
eval-judge rules — requires 3 retries with mixed outcomesself-heal-locate-fault with flaky flag to identify the root cause (race condition, timing window, state leak)Symptom: Eval completes with GREEN verdict but only the API driver ran — mobile driver was not configured, web driver was skipped, or a scenario surface was excluded.
Do NOT: Accept partial surface coverage as full eval gate passage.
Action:
status: SKIP with reason: not_applicableAfter eval passes and the ship-readiness score is GREEN (≥8.0), the conductor should auto-proceed through phase 5 without requiring human confirmation for these mechanical steps:
| Step | Auto-proceed? | Condition |
|---|---|---|
| Create PR | ✓ Yes | Score ≥ 8.0, no open review findings |
| Set PR description | ✓ Yes | Always |
| Request reviewers | ✓ Yes | If reviewer list is in brain |
| Merge PR | ✗ Human gate | Always requires human approval |
| Deploy to staging | ✗ Human gate | Always requires human approval |
Only stop for:
Everything else is auto. Do not pause to ask "should I proceed?" for GREEN eval results. Pausing for non-judgment calls wastes human attention on mechanical steps.
Before claiming eval gate passed:
semantic-eval-manifest.json outcome is pass (GREEN) — not yellow or fail.[P4.4-EVAL-PASS] logged to conductor.log after manifest written.python3 tools/verify/verify_forge_task.py exits 0 for this task.| Skill / Doc | Relationship |
|---|---|
eval-product-stack-up | Prerequisite — brings up full multi-service stack before drivers run |
eval-driver-api-http | Eval driver — executes HTTP/REST surface steps |
eval-driver-web-cdp | Eval driver — executes web UI surface steps |
eval-driver-db-mysql | Eval driver — verifies database state |
eval-driver-cache-redis | Eval driver — verifies cache state |
eval-driver-bus-kafka | Eval driver — verifies event bus messages |
eval-driver-search-es | Eval driver — verifies search index state |
eval-driver-ios-xctest | Eval driver — drives iOS simulator |
eval-driver-android-adb | Eval driver — drives Android device/emulator |
eval-judge | Downstream — reads semantic-eval-manifest.json + semantic-eval-run.log to produce GREEN/YELLOW/RED verdict |
self-heal-locate-fault | Downstream on RED — fault locator first step of self-heal loop |
docs/semantic-eval-schema.md | Artifact schema for semantic-eval-manifest.json and semantic-eval-run.log |
docs/conductor-log-format.md | [P4.4-EVAL-PASS], [P4.4-EVAL-FAIL], [P4.4-RED-INFRA] marker formats |