orchestrix-yuri 4.8.2 → 4.8.3
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.
- package/lib/gateway/router.js +23 -6
- package/package.json +1 -1
package/lib/gateway/router.js
CHANGED
|
@@ -552,18 +552,35 @@ class Router {
|
|
|
552
552
|
return { text: '❌ Usage: *change "description of the change"\n\nExample: *change "Add dark mode toggle to settings page"' };
|
|
553
553
|
}
|
|
554
554
|
|
|
555
|
-
// Step 1: Ask Claude to assess scope
|
|
555
|
+
// Step 1: Ask Claude to assess scope — with conversation context + project state
|
|
556
556
|
this.history.append(msg.chatId, 'user', msg.text);
|
|
557
557
|
log.router(`Change request: "${description.slice(0, 80)}..." — assessing scope...`);
|
|
558
558
|
|
|
559
|
+
// Build context: recent conversation + project focus
|
|
560
|
+
const recentMsgs = this.history.getRecent(msg.chatId);
|
|
561
|
+
const recentContext = recentMsgs.slice(-6).map((m) => `${m.role}: ${m.text.slice(0, 200)}`).join('\n');
|
|
562
|
+
|
|
563
|
+
let projectContext = '';
|
|
564
|
+
try {
|
|
565
|
+
const focusPath = path.join(projectRoot, '.yuri', 'focus.yaml');
|
|
566
|
+
if (fs.existsSync(focusPath)) {
|
|
567
|
+
const focus = yaml.load(fs.readFileSync(focusPath, 'utf8')) || {};
|
|
568
|
+
projectContext = `Current phase: ${focus.phase || '?'}, step: ${focus.step || '?'}, pulse: ${focus.pulse || '?'}`;
|
|
569
|
+
}
|
|
570
|
+
} catch { /* ok */ }
|
|
571
|
+
|
|
559
572
|
const scopePrompt = `You are assessing a change request for a software project.
|
|
560
573
|
|
|
561
|
-
Change description: "${description}"
|
|
574
|
+
${projectContext ? `Project state: ${projectContext}\n` : ''}${recentContext ? `Recent conversation:\n${recentContext}\n\n` : ''}Change description: "${description}"
|
|
575
|
+
|
|
576
|
+
IMPORTANT: Consider the FULL conversation context, not just the description.
|
|
577
|
+
If the user is approving/confirming a previously discussed plan that involves multiple components, stories, or a major redesign — that is medium or large, NOT small.
|
|
578
|
+
"批准" / "ok" / "go ahead" in response to a multi-story plan = large scope.
|
|
562
579
|
|
|
563
|
-
|
|
564
|
-
- **small**:
|
|
565
|
-
- **medium**: Cross-component change, needs PO routing
|
|
566
|
-
- **large**: Cross-module
|
|
580
|
+
Classify the scope as one of:
|
|
581
|
+
- **small**: Single-file fix, UI tweak, or isolated change (≤5 files, no architecture impact)
|
|
582
|
+
- **medium**: Cross-component change, needs PO routing (new API endpoint, refactoring a module)
|
|
583
|
+
- **large**: Cross-module change, multi-story plan, major redesign, needs full orchestration
|
|
567
584
|
|
|
568
585
|
Reply with ONLY one word: small, medium, or large. Nothing else.`;
|
|
569
586
|
|