@gotza02/sequential-thinking 2026.2.34 → 2026.2.35

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.
Files changed (2) hide show
  1. package/dist/lib.js +24 -0
  2. package/package.json +1 -1
package/dist/lib.js CHANGED
@@ -472,6 +472,30 @@ ${typeof wrappedThought === 'string' && wrappedThought.startsWith('│') ? wrapp
472
472
  if (executionCount >= 3 && input.thoughtType === 'execution') {
473
473
  warnings.push(`🛑 STRUGGLE DETECTED: You have executed 3+ commands in this block without reaching a solution. If you are fixing a bug and it's not working, STOP. Do not try a 4th time linearly. Use 'branchFromThought' to try a completely different approach.`);
474
474
  }
475
+ // Rule 8: Premature Solution Detection (Deep Thinker)
476
+ const hasObservation = blockThoughts.some(t => t.thoughtType === 'observation');
477
+ if (input.thoughtType === 'solution' && !hasObservation && blockThoughts.length < 4) {
478
+ warnings.push(`🤔 PREMATURE SOLUTION: You are concluding this block very quickly without any 'observation' (data verification). Are you hallucinating? Please verify with a tool first unless this is purely conceptual.`);
479
+ }
480
+ // Rule 9: Reflexion Quality Check
481
+ if (input.thoughtType === 'reflexion' && input.thought.length < 20) {
482
+ warnings.push(`📉 WEAK REFLEXION: Your reflexion is too short. Deepen your analysis. What went wrong? What did you learn? How does this change your plan?`);
483
+ }
484
+ // Rule 10: Mandatory Verification (Gatekeeper)
485
+ if (input.thoughtType === 'solution') {
486
+ const observations = blockThoughts.filter(t => t.thoughtType === 'observation');
487
+ if (observations.length === 0) {
488
+ warnings.push(`🚫 UNVERIFIED SOLUTION: You are attempting to solve without ANY observation/tool output in this block. You MUST verify your solution with a tool (e.g., test runner, file read, compilation) before concluding.`);
489
+ }
490
+ else {
491
+ const lastObservation = observations[observations.length - 1];
492
+ const failureKeywords = ['error', 'fail', 'exception', 'undefined', 'not found', 'enoent'];
493
+ const hasFailure = failureKeywords.some(kw => lastObservation.toolResult?.toLowerCase().includes(kw));
494
+ if (hasFailure) {
495
+ warnings.push(`⚠️ FAILURE DETECTED: The last observation contains failure signals ("${lastObservation.toolResult?.substring(0, 50)}..."). You cannot conclude with 'solution' yet. Fix the error first.`);
496
+ }
497
+ }
498
+ }
475
499
  // C. Update State
476
500
  this.addToMemory(input);
477
501
  await this.saveHistory();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gotza02/sequential-thinking",
3
- "version": "2026.2.34",
3
+ "version": "2026.2.35",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },