{ "_doc": "Mock fixture for Tester Agent (todo-be unit). sequence[0]=fail (first run after implement) with hint pointing at missing 400 branch; sequence[1]=pass (after Coder retry).", "sequence": [ { "_variant": "fail", "chunks": [ "## step 0 · 读 spec.json + contract.json + code/server.js\n", "\n## step 1-2 · 写 tests/todo-be.spec.js,覆盖 3 acceptance + 2 status code\n", "\n## step 3 · 跑 vitest\n", "1 of 3 failed\n", "\n## step 4 · parse_vitest + hint\n", "失败: POST /todos with empty body 返 201, 期望 400\n", "\n## step 5 · bug_open\n" ], "result": "mock-ok devloop-tester[fail] todo-be: 2/3 pass · failure has hint", "files": [ { "path": "units/todo-be/tests/todo-be.spec.js", "content": "// mock tests (P2 fixture)\nimport request from 'supertest';\nimport { describe, it, expect } from 'vitest';\nimport app from '../code/server.js';\ndescribe('todo-be', () => {\n it('POST /todos with text returns 201', async () => {\n const r = await request(app).post('/todos').send({ text: 'buy milk' });\n expect(r.status).toBe(201);\n });\n it('GET /todos returns array', async () => {\n const r = await request(app).get('/todos');\n expect(r.status).toBe(200);\n expect(Array.isArray(r.body)).toBe(true);\n });\n it('POST /todos with empty body returns 400', async () => {\n const r = await request(app).post('/todos').send({});\n expect(r.status).toBe(400);\n });\n});\n" }, { "path": "units/todo-be/runs/run-mock-attempt-1/result.json", "content": "{\n \"ok\": false,\n \"crashed\": false,\n \"unit_id\": \"todo-be\",\n \"run_id\": \"run-mock-attempt-1\",\n \"summary\": { \"total\": 3, \"passed\": 2, \"failed\": 1, \"skipped\": 0 },\n \"failures\": [\n {\n \"test\": \"POST /todos with empty body returns 400\",\n \"expected\": 400,\n \"got\": 201,\n \"stack\": \"AssertionError: expected 201 to be 400\",\n \"hint\": \"req.body.text 未校验;在 POST handler 入口加存在性判断,空 body 返 400 而不是 201\"\n }\n ],\n \"duration_ms\": 12\n}\n" } ] }, { "_variant": "pass", "chunks": [ "## step 0 · 读 spec.json + contract.json + code/server.js (已被 Coder 改动)\n", "\n## step 1 · 跑现有 tests (复用上一轮 spec)\n", "\n## step 2 · parse_vitest\n", "3 of 3 passed\n", "\n## step 3 · bug_transition fixed\n" ], "result": "mock-ok devloop-tester[pass] todo-be: 3/3 pass · L1 green", "files": [ { "path": "units/todo-be/runs/run-mock-attempt-2/result.json", "content": "{\n \"ok\": true,\n \"crashed\": false,\n \"unit_id\": \"todo-be\",\n \"run_id\": \"run-mock-attempt-2\",\n \"summary\": { \"total\": 3, \"passed\": 3, \"failed\": 0, \"skipped\": 0 },\n \"failures\": [],\n \"duration_ms\": 11\n}\n" } ] } ] }