diff --git a/packages/cloud-agents/src/__tests__/system-prompt.test.ts b/packages/cloud-agents/src/__tests__/system-prompt.test.ts index ffdfc38b1..53fc8cce2 100644 --- a/packages/cloud-agents/src/__tests__/system-prompt.test.ts +++ b/packages/cloud-agents/src/__tests__/system-prompt.test.ts @@ -8,16 +8,15 @@ describe('ROOMOTE_SYSTEM_PROMPT', () => { expect(ROOMOTE_SYSTEM_PROMPT).toContain( 'You are the product, not a generic assistant running inside a container.', ); + expect(ROOMOTE_SYSTEM_PROMPT).toContain( + 'You layer task-specific specialist behavior such as coder, planner, reviewer, and explainer on top of this core identity depending on the current job.', + ); expect(ROOMOTE_SYSTEM_PROMPT).not.toContain('# General'); expect(ROOMOTE_SYSTEM_PROMPT).not.toContain('## Frontend guidance'); expect(ROOMOTE_SYSTEM_PROMPT).not.toContain('## Editing constraints'); expect(ROOMOTE_SYSTEM_PROMPT).not.toContain('## Todo tracking'); - expect(ROOMOTE_SYSTEM_PROMPT).not.toContain('multi_tool_use.parallel'); - expect(ROOMOTE_SYSTEM_PROMPT).not.toContain('exec_command'); - expect(ROOMOTE_SYSTEM_PROMPT).not.toContain('Playwright'); - expect(ROOMOTE_SYSTEM_PROMPT).not.toContain('apply_patch'); - expect(ROOMOTE_SYSTEM_PROMPT).not.toContain( - 'follow the shared workspace guidance for the prepared repositories', - ); + expect(ROOMOTE_SYSTEM_PROMPT).not.toContain(''); + expect(ROOMOTE_SYSTEM_PROMPT).not.toContain(''); + expect(ROOMOTE_SYSTEM_PROMPT).not.toContain('create-draft-pr'); }); }); diff --git a/packages/cloud-agents/src/server/workflows/__tests__/standardTaskDraftDeliveryPolicy.test.ts b/packages/cloud-agents/src/server/workflows/__tests__/standardTaskDraftDeliveryPolicy.test.ts index 6e8273cf9..501e3af45 100644 --- a/packages/cloud-agents/src/server/workflows/__tests__/standardTaskDraftDeliveryPolicy.test.ts +++ b/packages/cloud-agents/src/server/workflows/__tests__/standardTaskDraftDeliveryPolicy.test.ts @@ -23,6 +23,37 @@ describe('Standard Task draft delivery policy', () => { ); }); + it('requires confirmed draft PR delivery before a repository-changing run succeeds', () => { + const { harnessInstructions } = standardTask({ + description: 'Implement and validate a repository change', + repo: 'Roomote/example-app', + taskRunUrl: 'https://example.com/task/123', + }); + const thisFilePath = fileURLToPath(import.meta.url); + const thisDirPath = path.dirname(thisFilePath); + const skillPath = path.resolve( + thisDirPath, + '../skills/standard/create-draft-pr/SKILL.md', + ); + const skillContent = fs.readFileSync(skillPath, 'utf8'); + + expect(harnessInstructions).toContain( + 'autonomous', + ); + expect(harnessInstructions).toContain( + 'After validation and self-review, the next required action for repository-changing work is delegated delivery, not final reporting.', + ); + expect(harnessInstructions).toContain( + 'the active `implement-changes` workflow stays responsible for the run until the required delivery result is known and must finish through the delegated `create-draft-pr` skill', + ); + expect(skillContent).toContain( + 'Collect the pull request number and URL returned by each successful `mcp__roomote__manage_source_control` result, and treat that tool result as the live pull request reference instead of treating the final message as proof that the pull request exists.', + ); + expect(skillContent).toContain( + 'Every changed repository now has a corresponding created or refreshed draft pull request confirmed by a `mcp__roomote__manage_source_control` result', + ); + }); + it('keeps ready-for-review delivery when the configured action is create', () => { const { harnessInstructions } = standardTask({ description: 'Implement behavior change', diff --git a/packages/cloud-agents/src/server/workflows/__tests__/standardTaskExplicitInvocationRouting.test.ts b/packages/cloud-agents/src/server/workflows/__tests__/standardTaskExplicitInvocationRouting.test.ts index d5d1fce03..3cbae7a46 100644 --- a/packages/cloud-agents/src/server/workflows/__tests__/standardTaskExplicitInvocationRouting.test.ts +++ b/packages/cloud-agents/src/server/workflows/__tests__/standardTaskExplicitInvocationRouting.test.ts @@ -45,6 +45,28 @@ describe('Standard Task explicit invocation routing', () => { ); }); + it('keeps the three required first-hop workflows in the routing contract', () => { + const { harnessInstructions } = standardTask({ + description: + 'Handle this repository request with the appropriate workflow', + repo: 'Roomote/example-app', + taskRunUrl: 'https://example.com/task/123', + }); + + expect(harnessInstructions).toContain( + '`implement-changes` for implementation, fixes, repository changes, and other action-oriented work.', + ); + expect(harnessInstructions).toContain( + '`plan-repo-implementation` for planning, scoping, or design work that should remain non-mutating', + ); + expect(harnessInstructions).toContain( + '`explain-repo-code` for understanding, explanation, and code-reading questions', + ); + expect(harnessInstructions).toContain( + 'Unless the request begins with an explicit skill invocation, always start with one of `implement-changes`, `plan-repo-implementation`, or `explain-repo-code`.', + ); + }); + it('uses implementation straightforwardness as the ambiguous-routing tiebreaker and otherwise defaults to plan', () => { const { harnessInstructions } = standardTask({ description: 'Maybe adjust the agent routing behavior if needed', diff --git a/packages/cloud-agents/src/server/workflows/__tests__/systemPrompt.test.ts b/packages/cloud-agents/src/server/workflows/__tests__/systemPrompt.test.ts index 500c7943e..41af426c1 100644 --- a/packages/cloud-agents/src/server/workflows/__tests__/systemPrompt.test.ts +++ b/packages/cloud-agents/src/server/workflows/__tests__/systemPrompt.test.ts @@ -11,13 +11,18 @@ describe('ROOMOTE_SYSTEM_PROMPT', () => { ); expect(ROOMOTE_SYSTEM_PROMPT).toContain('# Roomote Identity'); expect(ROOMOTE_SYSTEM_PROMPT).toContain('# Personality'); + expect(ROOMOTE_SYSTEM_PROMPT).toContain( + 'You work inside the codebase or codebases assigned by the current workspace and environment.', + ); + expect(ROOMOTE_SYSTEM_PROMPT).toContain( + 'You layer task-specific specialist behavior such as coder, planner, reviewer, and explainer on top of this core identity depending on the current job.', + ); expect(buildRoomoteSystemPrompt()).toContain( DEFAULT_ROOMOTE_STYLE_GUIDANCE, ); - expect(ROOMOTE_SYSTEM_PROMPT).not.toContain('Roomote-packaged skills'); - expect(ROOMOTE_SYSTEM_PROMPT).not.toContain('todo-management tool'); - expect(ROOMOTE_SYSTEM_PROMPT).not.toContain('commentary channel'); - expect(ROOMOTE_SYSTEM_PROMPT).not.toContain('Frontend guidance'); + expect(ROOMOTE_SYSTEM_PROMPT).not.toContain(''); + expect(ROOMOTE_SYSTEM_PROMPT).not.toContain(''); + expect(ROOMOTE_SYSTEM_PROMPT).not.toContain('create-draft-pr'); }); });