safepropel 1.4.0 → 1.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -209,12 +209,15 @@ class WorkflowExecutor {
209
209
  const workflow = this.runtime.get(promptPath);
210
210
 
211
211
  // Extract template reference ONLY from Output section to avoid loading multiple templates
212
- // Look for: "Generate the output using the `.propel/templates/xxx-template.md` template."
212
+ // Look for various patterns:
213
+ // - "Generate the output using the `.propel/templates/xxx-template.md` template"
214
+ // - "generate ... using `.propel/templates/xxx-template.md` template"
215
+ // - "using `.propel/templates/requirements-template.md` template"
213
216
  const outputSectionMatch = workflow.content.match(/## Output[\s\S]*?(?=##|$)/);
214
217
  const outputSection = outputSectionMatch ? outputSectionMatch[0] : workflow.content;
215
218
 
216
- // Extract template reference from output section only
217
- const templateMatch = outputSection.match(/Generate the output using the `(\.propel\/templates\/[a-z-]+\.md)` template/);
219
+ // Extract template reference from output section - flexible pattern
220
+ const templateMatch = outputSection.match(/using\s+`(\.propel\/templates\/[a-z-]+\.md)`\s+template/i);
218
221
  const templates = [];
219
222
 
220
223
  if (templateMatch) {
@@ -348,8 +351,13 @@ class WorkflowExecutor {
348
351
 
349
352
  prompt += `\n⚠️ CRITICAL TEMPLATE ENFORCEMENT for ${template.path}:\n`;
350
353
  prompt += `\n1. DOCUMENT TITLE:\n`;
351
- prompt += ` ✅ MUST be exactly: "${title}"\n`;
352
- prompt += ` DO NOT add prefixes, suffixes, or modify in any way\n`;
354
+ prompt += ` ✅ MUST be EXACTLY: "${title}"\n`;
355
+ prompt += ` Use NO project name, NO prefixes, NO suffixes, NO modifications\n`;
356
+ prompt += ` ❌ WRONG: "# Project Name - ${title}"\n`;
357
+ prompt += ` ❌ WRONG: "# ${title} - Project Name"\n`;
358
+ prompt += ` ❌ WRONG: "# ${title} for Project"\n`;
359
+ prompt += ` ✅ CORRECT: "# ${title}"\n`;
360
+ prompt += ` ⚠️ CRITICAL: The title "${title}" is the COMPLETE title - add NOTHING to it\n`;
353
361
 
354
362
  prompt += `\n2. REQUIRED SECTIONS (EXACT order and names):\n`;
355
363
  sectionList.forEach((section, idx) => {
@@ -386,14 +394,15 @@ class WorkflowExecutor {
386
394
 
387
395
  prompt += `\n6. MANDATORY ACTIONS:\n`;
388
396
  prompt += ` ✅ Use section names VERBATIM from list in step 2\n`;
397
+ prompt += ` ✅ Use document title VERBATIM from step 1 (no modifications)\n`;
389
398
  prompt += ` ✅ Fill bracketed placeholders [like this] with actual content\n`;
390
399
  prompt += ` ✅ Maintain exact heading levels (# ## ### ####)\n`;
391
400
  prompt += ` ✅ Include ONLY sections from template\n`;
392
401
  prompt += ` ✅ Skip [CONDITIONAL] sections if not applicable\n`;
393
402
  prompt += ` ✅ Follow requirement format patterns exactly\n`;
394
- prompt += ` ⚠️ CRITICAL: DO NOT generate ${title.replace(' Template', '')} content - ONLY use template structure\n`;
395
- prompt += ` ⚠️ CRITICAL: This is NOT a requirements document - this is a ${title}\n`;
396
- prompt += ` ⚠️ CRITICAL: NEVER create sections like "Feature Goal", "Business Justification", etc.\n`;
403
+ prompt += ` ⚠️ CRITICAL: Template structure is MANDATORY - no additions, no changes\n`;
404
+ prompt += ` ⚠️ CRITICAL: Section names and order are FIXED - use them exactly\n`;
405
+ prompt += ` ⚠️ CRITICAL: Document title is COMPLETE - do not prepend project name\n`;
397
406
 
398
407
  prompt += `\n7. TEMPLATE TYPE VALIDATION:\n`;
399
408
  prompt += ` 🔍 This is a "${title}" - NOT a requirements document\n`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "safepropel",
3
- "version": "1.4.0",
3
+ "version": "1.4.2",
4
4
  "description": "SafePropel Framework - Hybrid Security Model: Encrypted Workflows + Transparent Rules & Templates with Dynamic Loading",
5
5
  "main": "engine/workflow-executor.js",
6
6
  "scripts": {
package/safepropel.js CHANGED
@@ -291,13 +291,16 @@ function main() {
291
291
  console.log(` - Firewall enabled: ${result.metrics.firewallEnabled}`);
292
292
  }
293
293
 
294
- // Output the constructed prompt for Cascade execution
295
- if (constructedPrompt) {
294
+ // Output the constructed prompt for Cascade execution (only if authorized)
295
+ if (constructedPrompt && isAuthorizedCascade) {
296
296
  console.log(`\n` + '='.repeat(80));
297
297
  console.log('CONSTRUCTED PROMPT - Execute this in Cascade:');
298
298
  console.log('='.repeat(80));
299
299
  console.log(constructedPrompt);
300
300
  console.log('='.repeat(80));
301
+ } else if (constructedPrompt) {
302
+ console.log(`\n🔒 Workflow content is confidential and protected`);
303
+ console.log(` Execution requires --cascade-internal flag and authorized IDE`);
301
304
  }
302
305
 
303
306
  // Clean up any workflow-output.json files (security measure)