Skip to content

Commit e282c92

Browse files
brannnclaude
andcommitted
Strengthen example coverage enforcement in planner prompt
Emphasize that EVERY conditional branch needs an example with numbered rules and explicit "6 branches = 6 examples" guidance. Also updated auth example to request one example per branch. Fixes E012 errors on built-in examples. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 5cbbb8e commit e282c92

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

web/cmd/server/static/js/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ function startOver() {
366366
function loadExample(type) {
367367
var examples = {
368368
'minimal': 'A function that greets a user by name, returning a friendly greeting string.',
369-
'auth': 'User authentication that verifies email and password, returning user data on success or an error message on failure. Include data type definitions for User and AuthResult.',
369+
'auth': 'User authentication that verifies email and password, returning user data on success or an error message on failure. Include data type definitions for User and AuthResult. Provide one example per rule branch.',
370370
'cart': 'A shopping cart system with functions to add items, remove items, and calculate the total price. Items have id, name, price, and quantity. Keep each function to 3-4 rules maximum and provide one example per rule branch.',
371371
'evolution': 'Modernize an existing session-based authentication system to support JWT tokens alongside sessions, with refresh token rotation and rate limiting. Existing session-based clients must continue to work.'
372372
};

web/cmd/server/static/js/simplex-spec.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -297,11 +297,12 @@ const BASE_SYSTEM_PROMPT = `Generate Simplex v0.5 specifications. Follow this st
297297
5. EXAMPLES: (inside FUNCTION) - input/output pairs
298298
6. ERRORS: (inside FUNCTION) - error conditions
299299
300-
**RULES:**
301-
- Count "if" conditions in RULES
302-
- Provide AT LEAST that many EXAMPLES
303-
- Every branch needs an example
304-
- Always end ERRORS with: "any unhandled condition → fail with descriptive message"
300+
**CRITICAL RULES:**
301+
1. Count EVERY "if" condition in RULES (including "if not", "if no", "if empty", etc.)
302+
2. You MUST provide EXACTLY that many EXAMPLES (or more)
303+
3. Each conditional branch = one example. 6 branches = 6 examples minimum
304+
4. This is STRICTLY ENFORCED - specs will FAIL validation if examples < branches
305+
5. Always end ERRORS with: "any unhandled condition → fail with descriptive message"
305306
306307
**Optional landmarks (inside FUNCTION, use when spec requires):**
307308
- READS: Shared memory this function consumes (multi-agent coordination)

0 commit comments

Comments
 (0)