AIWorker Soul E2E Sampling
Use this skill to operate the AIWorker official Soul output-quality sampling loop. This is an execution workflow for real sampling evidence, not a generic AIWorker development guide and not a skill-authoring template.
Trigger Gate
Before using this skill, confirm all three gates:
- AIWorker repo identity: Locate the git root from the current working directory. Confirm root
AGENTS.mdcontainsAIWorker Agent Bootstrap, the five canonical docs exist,scripts/e2e-soul-sampling.tsexists, and official Soul packages exist undersouls/*. - Sampling operation intent: The user asks to run, continue, triage, retest, or tune the official Soul output-quality sampling loop.
- Official Soul or evidence target: The request targets existing official Soul
AGENTS.md, projected skills, or evidence undertmp/e2e-soul-sampling/.
If any gate fails, do not use this skill. For ambiguous prompts such as "跑 e2e" or "改 product-manager skill", ask one clarifying question to separate the Soul sampling loop from ordinary project development.
Do not use this skill for ordinary AIWorker feature work, generic E2E/contract/smoke tests, normal Soul authoring, new skill creation, sampling harness development, docs-only architecture work, or AGENTS/SKILL edits not driven by sampling evidence.
Zero-Trust Start
After the trigger gate passes, re-read current repo truth before choosing work:
AGENTS.mddocs/architecture.mddocs/protocol.mddocs/runtime.mddocs/soul-authoring.mddocs/testing.mdscripts/e2e-soul-sampling.tsscripts/e2e-soul-sampling.test.tsgit status --short- relevant recent commits
For execution tasks, run early:
bun run docs:check
bun run test:contracts
If test:contracts fails because a local dependency is missing, such as Cannot find package 'zod', try bun install and rerun the gate before declaring architecture drift.
Real Engine Rule
Unit or static tests for scripts/e2e-soul-sampling.ts may mock CLI behavior. E2E sampling must use real Worker CLI and real Codex invocations. Do not replace LLM-engine behavior with fake outputs, golden text, dry-run evidence, or mock-only validation.
Canonical real-run commands:
AIWORKER_E2E_RUN_ID=full-freeform AIWORKER_E2E_REASONING=high bun scripts/e2e-soul-sampling.ts run --soul aiworker-freeform
AIWORKER_E2E_RUN_ID=full-google-ads AIWORKER_E2E_REASONING=high bun scripts/e2e-soul-sampling.ts run --soul google-ads
AIWORKER_E2E_RUN_ID=full-hr-manager AIWORKER_E2E_REASONING=high bun scripts/e2e-soul-sampling.ts run --soul hr-manager
AIWORKER_E2E_RUN_ID=full-product-manager AIWORKER_E2E_REASONING=high bun scripts/e2e-soul-sampling.ts run --soul product-manager
AIWORKER_E2E_RUN_ID=full-software-support AIWORKER_E2E_REASONING=high bun scripts/e2e-soul-sampling.ts run --soul software-support
Use unique run IDs for retests, for example full-product-manager-agentsfix. Prefer serial runs unless the user explicitly wants parallel sampling and the machine can support it.
Evidence Review
Evidence lives under:
tmp/e2e-soul-sampling/<runId>/
manifest.json
scorecards/*.json
events/*.json
scorecard.status=pass means the invocation completed; it does not prove output quality. Always read assistant event text before judging quality:
jq -r '[.events[] | (.payloadJson.data.text // empty)] | join("")' \
tmp/e2e-soul-sampling/<runId>/events/<caseId>.json
Write ignored working summaries such as tmp/e2e-soul-sampling/<runId>/findings.md when reviewing multiple cases. Do not commit tmp/ evidence.
Finding Routing
Classify before editing:
| Finding | Default owner |
|---|---|
| AGENTS chooses the wrong workflow, leaks temp paths, misses domain boundaries, or fails to direct asset use | souls/*/engine/workspace/AGENTS.md |
| One workflow invents inputs, misses clarification, lacks self-check, or has weak delivery rules | souls/*/engine/skills/*/SKILL.md |
| Multiple skills repeat the same missing method, benchmark, integration, or domain rule | souls/*/engine/workspace/knowledge/* |
| Multiple outputs miss the same delivery structure | souls/*/engine/workspace/templates/* |
| CLI, session, projection, timeout, or engine bridge blocks real sampling before quality can be judged | platform code, smallest blocking slice only |
Edit the smallest asset that explains the failure. Shared knowledge or template changes require repeated evidence across multiple cases.
Fix And Retest Loop
For each verified finding:
- Classify the failure from assistant event text.
- Edit the smallest responsible Soul asset.
- Build or validate the affected Soul package.
- Confirm tracked
dist/engine-assetsoutput is synchronized when the package generates it. - Retest with real Codex using the affected Soul or the narrowest supported case.
- Re-read assistant event text and update findings.
- Commit the verified slice without
tmp/evidence.
Example validation commands:
bun run --filter '@zonease/aiworker-product-manager' validate
bun run --filter '@zonease/aiworker-software-support' validate
Completion Gate
Before claiming completion, run the smallest fresh verification set that proves the touched surface. Common commands:
bun run docs:check
bun run test:contracts
bun test scripts/e2e-soul-sampling.test.ts --timeout=30000
bun test packages/worker-runtime/src/worker/executor.test.ts --timeout=30000
For code changes, run code-review-graph unless the change is docs-only, instruction-only, or pure formatting.
Source: ZonEaseTech/aiworker — distributed by TomeVault.