-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Labels
create-expertcreate-expert CLI packagecreate-expert CLI packagerefactorCode improvement without behavior changeCode improvement without behavior change
Description
Description
The expert-tester uses shell execution via exec to run experts for testing rather than using the delegation pattern. This bypasses the delegation model that other experts in the system follow.
Current Behavior
EXPERT_TESTER_INSTRUCTION (lines 482-485) instructs:
### 1. Execute Tests
For each test case, run:
\`\`\`bash
npx -y perstack run expert-name "test query" --workspace . --filter completeRun
\`\`\`Design Inconsistency
The create-expert system uses delegation extensively:
create-expert→ delegates toproperty-extractor,ecosystem-builder, etc.integration-manager→ delegates tofunctional-manager,usability-managerfunctional-manager→ delegates toexpert-tester
But expert-tester breaks this pattern by using shell execution.
Considerations
Why exec might be intentional:
- Testing requires running the expert as an independent process
- The tested expert may not be part of the same delegation hierarchy
- Testing requires observing external behavior (stdout/stderr)
Why delegation would be better:
- Consistency with the rest of the system
- Better error handling (delegation failure handling is built-in)
- Avoids shell escape issues
Recommendation
Document the design decision explicitly. If exec is intentional, explain why in the instruction. If delegation is preferred, the tested experts should be added as delegates.
Affected Areas
apps/create-expert/src/lib/create-expert-toml.ts:466-527(EXPERT_TESTER_INSTRUCTION)
Acceptance Criteria
- Either add a comment explaining why exec is used instead of delegation
- OR refactor to use delegation if appropriate
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
create-expertcreate-expert CLI packagecreate-expert CLI packagerefactorCode improvement without behavior changeCode improvement without behavior change