update e2e

This commit is contained in:
nrslib 2026-02-07 22:59:19 +09:00
parent ad42c5bacd
commit 1d3ba5d0f6
9 changed files with 50 additions and 51 deletions

View File

@ -6,7 +6,7 @@ max_iterations: 3
movements: movements:
- name: execute - name: execute
edit: true edit: true
agent: ../agents/test-coder.md persona: ../agents/test-coder.md
allowed_tools: allowed_tools:
- Read - Read
- Write - Write

View File

@ -7,7 +7,7 @@ initial_movement: plan
movements: movements:
- name: plan - name: plan
agent: ../agents/test-coder.md persona: ../agents/test-coder.md
edit: true edit: true
permission_mode: edit permission_mode: edit
instruction_template: | instruction_template: |
@ -19,14 +19,14 @@ movements:
- name: review - name: review
parallel: parallel:
- name: arch-review - name: arch-review
agent: ../agents/test-reviewer-a.md persona: ../agents/test-reviewer-a.md
instruction_template: | instruction_template: |
Review the architecture. Review the architecture.
rules: rules:
- condition: approved - condition: approved
- condition: needs_fix - condition: needs_fix
- name: security-review - name: security-review
agent: ../agents/test-reviewer-b.md persona: ../agents/test-reviewer-b.md
instruction_template: | instruction_template: |
Review security. Review security.
rules: rules:
@ -39,7 +39,7 @@ movements:
next: fix next: fix
- name: fix - name: fix
agent: ../agents/test-coder.md persona: ../agents/test-coder.md
edit: true edit: true
permission_mode: edit permission_mode: edit
instruction_template: | instruction_template: |

View File

@ -6,13 +6,15 @@ max_iterations: 3
movements: movements:
- name: execute - name: execute
edit: true edit: true
agent: ../agents/test-reporter.md persona: ../agents/test-reporter.md
allowed_tools: allowed_tools:
- Read - Read
- Write - Write
- Edit - Edit
permission_mode: edit permission_mode: edit
report: report.md output_contracts:
report:
- Report: report.md
instruction_template: | instruction_template: |
{task} {task}
rules: rules:

View File

@ -6,7 +6,7 @@ max_iterations: 5
movements: movements:
- name: execute - name: execute
edit: true edit: true
agent: ../agents/test-coder.md persona: ../agents/test-coder.md
allowed_tools: allowed_tools:
- Read - Read
- Write - Write

View File

@ -1,6 +1,6 @@
[ [
{ {
"agent": "summarizer", "persona": "summarizer",
"status": "done", "status": "done",
"content": "add-task" "content": "add-task"
} }

View File

@ -1,7 +1,7 @@
[ [
{ "agent": "test-coder", "status": "done", "content": "Plan created." }, { "persona": "test-coder", "status": "done", "content": "Plan created." },
{ "agent": "test-reviewer-a", "status": "done", "content": "Architecture approved." }, { "persona": "test-reviewer-a", "status": "done", "content": "Architecture approved." },
{ "agent": "test-reviewer-b", "status": "done", "content": "Security approved." }, { "persona": "test-reviewer-b", "status": "done", "content": "Security approved." },
{ "agent": "conductor", "status": "done", "content": "[ARCH-REVIEW:1] [SECURITY-REVIEW:1]" }, { "persona": "conductor", "status": "done", "content": "[ARCH-REVIEW:1] [SECURITY-REVIEW:1]" },
{ "agent": "conductor", "status": "done", "content": "[ARCH-REVIEW:1] [SECURITY-REVIEW:1]" } { "persona": "conductor", "status": "done", "content": "[ARCH-REVIEW:1] [SECURITY-REVIEW:1]" }
] ]

View File

@ -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." }, { "persona": "test-reviewer-a", "status": "done", "content": "Architecture looks good." },
{ "agent": "test-reviewer-b", "status": "done", "content": "Security issues found." }, { "persona": "test-reviewer-b", "status": "done", "content": "Security issues found." },
{ "agent": "conductor", "status": "done", "content": "[ARCH-REVIEW:1] [SECURITY-REVIEW:2]" }, { "persona": "conductor", "status": "done", "content": "[ARCH-REVIEW:1] [SECURITY-REVIEW:2]" },
{ "agent": "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." }, { "persona": "test-reviewer-a", "status": "done", "content": "Architecture still approved." },
{ "agent": "test-reviewer-b", "status": "done", "content": "Security now approved." }, { "persona": "test-reviewer-b", "status": "done", "content": "Security now approved." },
{ "agent": "conductor", "status": "done", "content": "[ARCH-REVIEW:1] [SECURITY-REVIEW:1]" }, { "persona": "conductor", "status": "done", "content": "[ARCH-REVIEW:1] [SECURITY-REVIEW:1]" },
{ "agent": "conductor", "status": "done", "content": "[ARCH-REVIEW:1] [SECURITY-REVIEW:1]" } { "persona": "conductor", "status": "done", "content": "[ARCH-REVIEW:1] [SECURITY-REVIEW:1]" }
] ]

View File

@ -1,16 +1,16 @@
[ [
{ {
"agent": "test-reporter", "persona": "test-reporter",
"status": "done", "status": "done",
"content": "Work completed." "content": "Work completed."
}, },
{ {
"agent": "test-reporter", "persona": "test-reporter",
"status": "done", "status": "done",
"content": "Report summary: OK" "content": "Report summary: OK"
}, },
{ {
"agent": "conductor", "persona": "conductor",
"status": "done", "status": "done",
"content": "[EXECUTE:1]" "content": "[EXECUTE:1]"
} }

View File

@ -79,14 +79,14 @@ describe('E2E: Eject builtin pieces (takt eject)', () => {
const piecePath = join(repo.path, '.takt', 'pieces', 'default.yaml'); const piecePath = join(repo.path, '.takt', 'pieces', 'default.yaml');
expect(existsSync(piecePath)).toBe(true); expect(existsSync(piecePath)).toBe(true);
// Agents should be in project .takt/agents/ // Personas should be in project .takt/personas/
const agentsDir = join(repo.path, '.takt', 'agents', 'default'); const personasDir = join(repo.path, '.takt', 'personas');
expect(existsSync(agentsDir)).toBe(true); expect(existsSync(personasDir)).toBe(true);
expect(existsSync(join(agentsDir, 'coder.md'))).toBe(true); expect(existsSync(join(personasDir, 'coder.md'))).toBe(true);
expect(existsSync(join(agentsDir, 'planner.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({ runTakt({
args: ['eject', 'default'], args: ['eject', 'default'],
cwd: repo.path, cwd: repo.path,
@ -96,10 +96,10 @@ describe('E2E: Eject builtin pieces (takt eject)', () => {
const piecePath = join(repo.path, '.takt', 'pieces', 'default.yaml'); const piecePath = join(repo.path, '.takt', 'pieces', 'default.yaml');
const content = readFileSync(piecePath, 'utf-8'); const content = readFileSync(piecePath, 'utf-8');
// Relative paths should be preserved as ../agents/ // Relative paths should be preserved as ../personas/
expect(content).toContain('agent: ../agents/default/'); expect(content).toContain('../personas/');
// Should NOT contain rewritten absolute paths // 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', () => { 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'); const piecePath = join(isolatedEnv.taktDir, 'pieces', 'default.yaml');
expect(existsSync(piecePath)).toBe(true); expect(existsSync(piecePath)).toBe(true);
// Agents should be in global agents dir // Personas should be in global personas dir
const agentsDir = join(isolatedEnv.taktDir, 'agents', 'default'); const personasDir = join(isolatedEnv.taktDir, 'personas');
expect(existsSync(agentsDir)).toBe(true); expect(existsSync(personasDir)).toBe(true);
expect(existsSync(join(agentsDir, 'coder.md'))).toBe(true); expect(existsSync(join(personasDir, 'coder.md'))).toBe(true);
// Should NOT be in project dir // Should NOT be in project dir
const projectPiecePath = join(repo.path, '.takt', 'pieces', 'default.yaml'); 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'); 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({ const result = runTakt({
args: ['eject', 'magi'], args: ['eject', 'magi'],
cwd: repo.path, cwd: repo.path,
@ -164,14 +164,11 @@ describe('E2E: Eject builtin pieces (takt eject)', () => {
expect(result.exitCode).toBe(0); expect(result.exitCode).toBe(0);
// MAGI piece should have its own agents // MAGI piece should have its personas ejected
const magiDir = join(repo.path, '.takt', 'agents', 'magi'); const personasDir = join(repo.path, '.takt', 'personas');
expect(existsSync(join(magiDir, 'melchior.md'))).toBe(true); expect(existsSync(join(personasDir, 'melchior.md'))).toBe(true);
expect(existsSync(join(magiDir, 'balthasar.md'))).toBe(true); expect(existsSync(join(personasDir, 'balthasar.md'))).toBe(true);
expect(existsSync(join(magiDir, 'casper.md'))).toBe(true); expect(existsSync(join(personasDir, 'casper.md'))).toBe(true);
// Should NOT have default agents mixed in
expect(existsSync(join(repo.path, '.takt', 'agents', 'default'))).toBe(false);
}); });
it('should preserve relative paths for global eject too', () => { 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 piecePath = join(isolatedEnv.taktDir, 'pieces', 'magi.yaml');
const content = readFileSync(piecePath, 'utf-8'); const content = readFileSync(piecePath, 'utf-8');
expect(content).toContain('agent: ../agents/magi/'); expect(content).toContain('../personas/');
expect(content).not.toContain('agent: ~/.takt/agents/'); expect(content).not.toContain('~/.takt/personas/');
}); });
}); });