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:
- name: execute
edit: true
agent: ../agents/test-coder.md
persona: ../agents/test-coder.md
allowed_tools:
- Read
- Write

View File

@ -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: |

View File

@ -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:

View File

@ -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

View File

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

View File

@ -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]" }
]

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." },
{ "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]" }
]

View File

@ -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]"
}

View File

@ -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/');
});
});