fix: tester prompts — build before list, remove non-existent dry-run command

- Both workflow/sense tester: build first, then validate, then list
- workflow-generator: remove nerve workflow dry-run (doesn't exist)
- sense-generator: add build step before sense list/trigger
This commit is contained in:
小橘 2026-04-28 11:04:31 +00:00
parent 6778ba5246
commit 7fb161cf96
2 changed files with 45 additions and 23 deletions

View File

@ -4,13 +4,29 @@ export function testerPrompt({ threadId }: { threadId: string }): string {
Read the workflow thread for context: \`nerve thread ${threadId}\` Read the workflow thread for context: \`nerve thread ${threadId}\`
Read the nerve-dev skill for expected file structure: \`cat node_modules/@uncaged/nerve-skills/nerve-dev/SKILL.md\` Read the nerve-dev skill for expected file structure: \`cat node_modules/@uncaged/nerve-skills/nerve-dev/SKILL.md\`
Verify the full lifecycle: Verify the full lifecycle in this order:
1. Check all required sense files exist
2. Check nerve.yaml has the sense config 1. **File check** all required sense files exist:
3. Run \`nerve sense list\` — confirm the sense appears - \`senses/<name>/src/index.ts\`
4. Run \`nerve sense trigger <sense-name>\` — should complete without error - \`senses/<name>/src/schema.ts\`
5. Run \`nerve sense query <sense-name>\` — retry up to 20s until rows appear - \`senses/<name>/migrations/\`
6. If any step fails, run \`nerve logs\` and include relevant errors - \`senses/<name>/package.json\`
2. **Build** run inside the sense directory:
\`\`\`
cd senses/<name> && pnpm install --no-cache && pnpm build
\`\`\`
Must produce \`index.js\` at sense root without errors.
3. **Config check** \`nerve validate\` passes, confirming nerve.yaml is valid.
4. **Sense list** \`nerve sense list\` shows the sense.
5. **Trigger** \`nerve sense trigger <name>\` completes without error.
6. **Query** \`nerve sense query <name>\` — retry up to 20s until rows appear.
If any step fails, include the relevant error output.
Output a clear summary: what you checked, what passed, what failed, and why.`; Output a clear summary: what you checked, what passed, what failed, and why.`;
} }

View File

@ -6,22 +6,28 @@ Read the nerve-dev skill for expected file structure: \`cat node_modules/@uncage
Get the workflow name from the thread (the planner's output). Get the workflow name from the thread (the planner's output).
Verify the full lifecycle: Verify the full lifecycle in this order:
1. Check all required workflow files exist: index.ts, package.json, tsconfig.json
2. Check nerve.yaml has the workflow config
3. Run \`nerve workflow list\` — confirm the workflow appears
4. Run \`pnpm build\` inside the workflow directory — must succeed
5. Run \`nerve workflow dry-run <workflow-name>\` — should complete without error
6. If any step fails, include the relevant error output
Output a clear summary: what you checked, what passed, what failed, and why. 1. **File check** all required workflow files exist:
- \`workflows/<name>/index.ts\`
- \`workflows/<name>/build.ts\`
- \`workflows/<name>/moderator.ts\`
- \`workflows/<name>/roles/\` with subdirectories
- \`workflows/<name>/package.json\`
End your response with a JSON block: 2. **Build** run inside the workflow directory:
\`\`\`json \`\`\`
{ "passed": true } cd workflows/<name> && pnpm install --no-cache && pnpm build
\`\`\` \`\`\`
or Must produce \`dist/index.js\` without errors.
\`\`\`json
{ "passed": false } 3. **Config check** \`nerve validate\` passes, confirming nerve.yaml is valid.
\`\`\``;
4. **Workflow list** \`nerve workflow list\` shows the workflow.
5. **Trigger test** \`nerve workflow trigger <name> --dry-run\` if available, otherwise just confirm the workflow appears in \`nerve workflow status\`.
If any step fails, include the relevant error output.
Output a clear summary: what you checked, what passed, what failed, and why.`;
} }