diff --git a/e2e/fixtures/pieces/mock-single-step.yaml b/e2e/fixtures/pieces/mock-single-step.yaml index 2253c79..6ad42fb 100644 --- a/e2e/fixtures/pieces/mock-single-step.yaml +++ b/e2e/fixtures/pieces/mock-single-step.yaml @@ -6,7 +6,7 @@ max_iterations: 3 movements: - name: execute edit: true - agent: ../agents/test-coder.md + persona: ../agents/test-coder.md allowed_tools: - Read - Write diff --git a/e2e/fixtures/pieces/multi-step-parallel.yaml b/e2e/fixtures/pieces/multi-step-parallel.yaml index 0a63f02..d33354b 100644 --- a/e2e/fixtures/pieces/multi-step-parallel.yaml +++ b/e2e/fixtures/pieces/multi-step-parallel.yaml @@ -7,7 +7,7 @@ initial_movement: plan movements: - name: plan - agent: ../agents/test-coder.md + persona: ../agents/test-coder.md edit: true permission_mode: edit instruction_template: | @@ -19,14 +19,14 @@ movements: - name: review parallel: - name: arch-review - agent: ../agents/test-reviewer-a.md + persona: ../agents/test-reviewer-a.md instruction_template: | Review the architecture. rules: - condition: approved - condition: needs_fix - name: security-review - agent: ../agents/test-reviewer-b.md + persona: ../agents/test-reviewer-b.md instruction_template: | Review security. rules: @@ -39,7 +39,7 @@ movements: next: fix - name: fix - agent: ../agents/test-coder.md + persona: ../agents/test-coder.md edit: true permission_mode: edit instruction_template: | diff --git a/e2e/fixtures/pieces/report-judge.yaml b/e2e/fixtures/pieces/report-judge.yaml index 0e24d06..4e44c7d 100644 --- a/e2e/fixtures/pieces/report-judge.yaml +++ b/e2e/fixtures/pieces/report-judge.yaml @@ -6,13 +6,15 @@ max_iterations: 3 movements: - name: execute edit: true - agent: ../agents/test-reporter.md + persona: ../agents/test-reporter.md allowed_tools: - Read - Write - Edit permission_mode: edit - report: report.md + output_contracts: + report: + - Report: report.md instruction_template: | {task} rules: diff --git a/e2e/fixtures/pieces/simple.yaml b/e2e/fixtures/pieces/simple.yaml index b2a9853..9619c33 100644 --- a/e2e/fixtures/pieces/simple.yaml +++ b/e2e/fixtures/pieces/simple.yaml @@ -6,7 +6,7 @@ max_iterations: 5 movements: - name: execute edit: true - agent: ../agents/test-coder.md + persona: ../agents/test-coder.md allowed_tools: - Read - Write diff --git a/e2e/fixtures/scenarios/add-task.json b/e2e/fixtures/scenarios/add-task.json index 1fb9fa5..ab57327 100644 --- a/e2e/fixtures/scenarios/add-task.json +++ b/e2e/fixtures/scenarios/add-task.json @@ -1,6 +1,6 @@ [ { - "agent": "summarizer", + "persona": "summarizer", "status": "done", "content": "add-task" } diff --git a/e2e/fixtures/scenarios/multi-step-all-approved.json b/e2e/fixtures/scenarios/multi-step-all-approved.json index 5fc97cb..5392a8b 100644 --- a/e2e/fixtures/scenarios/multi-step-all-approved.json +++ b/e2e/fixtures/scenarios/multi-step-all-approved.json @@ -1,7 +1,7 @@ [ - { "agent": "test-coder", "status": "done", "content": "Plan created." }, - { "agent": "test-reviewer-a", "status": "done", "content": "Architecture approved." }, - { "agent": "test-reviewer-b", "status": "done", "content": "Security approved." }, - { "agent": "conductor", "status": "done", "content": "[ARCH-REVIEW:1] [SECURITY-REVIEW:1]" }, - { "agent": "conductor", "status": "done", "content": "[ARCH-REVIEW:1] [SECURITY-REVIEW:1]" } + { "persona": "test-coder", "status": "done", "content": "Plan created." }, + { "persona": "test-reviewer-a", "status": "done", "content": "Architecture approved." }, + { "persona": "test-reviewer-b", "status": "done", "content": "Security approved." }, + { "persona": "conductor", "status": "done", "content": "[ARCH-REVIEW:1] [SECURITY-REVIEW:1]" }, + { "persona": "conductor", "status": "done", "content": "[ARCH-REVIEW:1] [SECURITY-REVIEW:1]" } ] diff --git a/e2e/fixtures/scenarios/multi-step-needs-fix.json b/e2e/fixtures/scenarios/multi-step-needs-fix.json index a46b5c7..52b595d 100644 --- a/e2e/fixtures/scenarios/multi-step-needs-fix.json +++ b/e2e/fixtures/scenarios/multi-step-needs-fix.json @@ -1,15 +1,15 @@ [ - { "agent": "test-coder", "status": "done", "content": "Plan created." }, + { "persona": "test-coder", "status": "done", "content": "Plan created." }, - { "agent": "test-reviewer-a", "status": "done", "content": "Architecture looks good." }, - { "agent": "test-reviewer-b", "status": "done", "content": "Security issues found." }, - { "agent": "conductor", "status": "done", "content": "[ARCH-REVIEW:1] [SECURITY-REVIEW:2]" }, - { "agent": "conductor", "status": "done", "content": "[ARCH-REVIEW:1] [SECURITY-REVIEW:2]" }, + { "persona": "test-reviewer-a", "status": "done", "content": "Architecture looks good." }, + { "persona": "test-reviewer-b", "status": "done", "content": "Security issues found." }, + { "persona": "conductor", "status": "done", "content": "[ARCH-REVIEW:1] [SECURITY-REVIEW:2]" }, + { "persona": "conductor", "status": "done", "content": "[ARCH-REVIEW:1] [SECURITY-REVIEW:2]" }, - { "agent": "test-coder", "status": "done", "content": "Fix applied." }, + { "persona": "test-coder", "status": "done", "content": "Fix applied." }, - { "agent": "test-reviewer-a", "status": "done", "content": "Architecture still approved." }, - { "agent": "test-reviewer-b", "status": "done", "content": "Security now approved." }, - { "agent": "conductor", "status": "done", "content": "[ARCH-REVIEW:1] [SECURITY-REVIEW:1]" }, - { "agent": "conductor", "status": "done", "content": "[ARCH-REVIEW:1] [SECURITY-REVIEW:1]" } + { "persona": "test-reviewer-a", "status": "done", "content": "Architecture still approved." }, + { "persona": "test-reviewer-b", "status": "done", "content": "Security now approved." }, + { "persona": "conductor", "status": "done", "content": "[ARCH-REVIEW:1] [SECURITY-REVIEW:1]" }, + { "persona": "conductor", "status": "done", "content": "[ARCH-REVIEW:1] [SECURITY-REVIEW:1]" } ] diff --git a/e2e/fixtures/scenarios/report-judge.json b/e2e/fixtures/scenarios/report-judge.json index a73865e..7277cc2 100644 --- a/e2e/fixtures/scenarios/report-judge.json +++ b/e2e/fixtures/scenarios/report-judge.json @@ -1,16 +1,16 @@ [ { - "agent": "test-reporter", + "persona": "test-reporter", "status": "done", "content": "Work completed." }, { - "agent": "test-reporter", + "persona": "test-reporter", "status": "done", "content": "Report summary: OK" }, { - "agent": "conductor", + "persona": "conductor", "status": "done", "content": "[EXECUTE:1]" } diff --git a/e2e/specs/eject.e2e.ts b/e2e/specs/eject.e2e.ts index fbf5c85..975ec9f 100644 --- a/e2e/specs/eject.e2e.ts +++ b/e2e/specs/eject.e2e.ts @@ -79,14 +79,14 @@ describe('E2E: Eject builtin pieces (takt eject)', () => { const piecePath = join(repo.path, '.takt', 'pieces', 'default.yaml'); expect(existsSync(piecePath)).toBe(true); - // Agents should be in project .takt/agents/ - const agentsDir = join(repo.path, '.takt', 'agents', 'default'); - expect(existsSync(agentsDir)).toBe(true); - expect(existsSync(join(agentsDir, 'coder.md'))).toBe(true); - expect(existsSync(join(agentsDir, 'planner.md'))).toBe(true); + // Personas should be in project .takt/personas/ + const personasDir = join(repo.path, '.takt', 'personas'); + expect(existsSync(personasDir)).toBe(true); + expect(existsSync(join(personasDir, 'coder.md'))).toBe(true); + expect(existsSync(join(personasDir, 'planner.md'))).toBe(true); }); - it('should preserve relative agent paths in ejected piece (no rewriting)', () => { + it('should preserve relative persona paths in ejected piece (no rewriting)', () => { runTakt({ args: ['eject', 'default'], cwd: repo.path, @@ -96,10 +96,10 @@ describe('E2E: Eject builtin pieces (takt eject)', () => { const piecePath = join(repo.path, '.takt', 'pieces', 'default.yaml'); const content = readFileSync(piecePath, 'utf-8'); - // Relative paths should be preserved as ../agents/ - expect(content).toContain('agent: ../agents/default/'); + // Relative paths should be preserved as ../personas/ + expect(content).toContain('../personas/'); // Should NOT contain rewritten absolute paths - expect(content).not.toContain('agent: ~/.takt/agents/'); + expect(content).not.toContain('~/.takt/personas/'); }); it('should eject piece to global ~/.takt/ with --global flag', () => { @@ -115,10 +115,10 @@ describe('E2E: Eject builtin pieces (takt eject)', () => { const piecePath = join(isolatedEnv.taktDir, 'pieces', 'default.yaml'); expect(existsSync(piecePath)).toBe(true); - // Agents should be in global agents dir - const agentsDir = join(isolatedEnv.taktDir, 'agents', 'default'); - expect(existsSync(agentsDir)).toBe(true); - expect(existsSync(join(agentsDir, 'coder.md'))).toBe(true); + // Personas should be in global personas dir + const personasDir = join(isolatedEnv.taktDir, 'personas'); + expect(existsSync(personasDir)).toBe(true); + expect(existsSync(join(personasDir, 'coder.md'))).toBe(true); // Should NOT be in project dir const projectPiecePath = join(repo.path, '.takt', 'pieces', 'default.yaml'); @@ -155,7 +155,7 @@ describe('E2E: Eject builtin pieces (takt eject)', () => { expect(result.stdout).toContain('not found'); }); - it('should correctly eject agents for pieces with unique agents', () => { + it('should correctly eject personas for pieces with unique personas', () => { const result = runTakt({ args: ['eject', 'magi'], cwd: repo.path, @@ -164,14 +164,11 @@ describe('E2E: Eject builtin pieces (takt eject)', () => { expect(result.exitCode).toBe(0); - // MAGI piece should have its own agents - const magiDir = join(repo.path, '.takt', 'agents', 'magi'); - expect(existsSync(join(magiDir, 'melchior.md'))).toBe(true); - expect(existsSync(join(magiDir, 'balthasar.md'))).toBe(true); - expect(existsSync(join(magiDir, 'casper.md'))).toBe(true); - - // Should NOT have default agents mixed in - expect(existsSync(join(repo.path, '.takt', 'agents', 'default'))).toBe(false); + // MAGI piece should have its personas ejected + const personasDir = join(repo.path, '.takt', 'personas'); + expect(existsSync(join(personasDir, 'melchior.md'))).toBe(true); + expect(existsSync(join(personasDir, 'balthasar.md'))).toBe(true); + expect(existsSync(join(personasDir, 'casper.md'))).toBe(true); }); it('should preserve relative paths for global eject too', () => { @@ -184,7 +181,7 @@ describe('E2E: Eject builtin pieces (takt eject)', () => { const piecePath = join(isolatedEnv.taktDir, 'pieces', 'magi.yaml'); const content = readFileSync(piecePath, 'utf-8'); - expect(content).toContain('agent: ../agents/magi/'); - expect(content).not.toContain('agent: ~/.takt/agents/'); + expect(content).toContain('../personas/'); + expect(content).not.toContain('~/.takt/personas/'); }); });