devloop-architect.json
9.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
{
"_doc": "Mock fixture for Architect Agent — drives P1 acceptance (todo-demo project). Produces SDD multi-page site + units.json (3 units) + integration/spec.json + architect agent-state + history snapshot.",
"chunks": [
"## 第 1 步: 读 PRD\n",
"已读 prd/feature/feature-tree.html — 3 个 Unit。\n",
"\n## 第 2 步: 写 sdd/mvcp/\n",
"model · view · control · process\n",
"\n## 第 3 步: 写 units.json + integration/spec.json\n",
"todo-be / todo-fe / todo-db,DAG 无环。\n",
"\n## 完成\n",
"SDD v1 已交付,units.json l2_rounds 初值 0/3。\n"
],
"result": "mock-ok devloop-architect: SDD v1 + 3 units + 1 integration case",
"files": [
{
"path": "sdd/index.html",
"content": "<!doctype html><html><head><meta charset=\"utf-8\"><title>SDD · todo-demo</title><link rel=\"stylesheet\" href=\"assets/shell.css\"></head><body data-page=\"index.html\"><article data-doc=\"sdd\" data-rev=\"1\"><section data-rev=\"1\" data-origin=\"system@2026-05-13T10:01:00.000Z\"><h3>SDD 首页</h3><p>todo-demo · M/V/C/P 设计</p><table><tr><th>层</th><th>页</th></tr><tr><td>M</td><td>mvcp/model.html</td></tr></table><pre>M -> V -> C -> P</pre><svg width=\"100\" height=\"20\"><line x1=\"0\" y1=\"10\" x2=\"100\" y2=\"10\" marker-end=\"url(#a)\"/></svg><div class=\"card\">导航</div></section></article><script src=\"assets/shell.js\"></script></body></html>"
},
{
"path": "sdd/mvcp/model.html",
"content": "<!doctype html><html><head><meta charset=\"utf-8\"><title>Model</title><link rel=\"stylesheet\" href=\"../assets/shell.css\"></head><body data-page=\"mvcp/model.html\"><article data-doc=\"sdd\" data-rev=\"1\"><section data-rev=\"1\" data-unit-id=\"todo-be\"><h3>M-1 Todo Entity</h3><p>{ id:int, text:str, done:bool, created_at:ISO }</p><table><tr><th>field</th><th>type</th></tr><tr><td>id</td><td>integer</td></tr><tr><td>text</td><td>string</td></tr></table><pre>schema: id PK · text NOT NULL</pre><svg width=\"80\" height=\"20\"><rect width=\"80\" height=\"20\" fill=\"#eef\"/></svg><div class=\"card\">model</div></section><section data-rev=\"1\" data-unit-id=\"todo-fe\"><h3>M-2 FE State</h3><p>list: Todo[]; loading: bool</p><table><tr><td>list</td><td>Todo[]</td></tr></table><pre>vue ref</pre><svg width=\"40\" height=\"20\"><line x1=\"0\" y1=\"10\" x2=\"40\" y2=\"10\"/></svg><div class=\"card\">fe</div></section><section data-rev=\"1\" data-unit-id=\"todo-db\"><h3>M-3 DB Schema</h3><p>CREATE TABLE todos(id INTEGER PRIMARY KEY,text TEXT,done INT,created_at TEXT);</p><table><tr><td>todos</td><td>table</td></tr></table><pre>sqlite</pre><svg width=\"40\" height=\"20\"></svg><div class=\"card\">db</div></section></article></body></html>"
},
{
"path": "sdd/mvcp/view.html",
"content": "<!doctype html><html><head><meta charset=\"utf-8\"><title>View</title><link rel=\"stylesheet\" href=\"../assets/shell.css\"></head><body data-page=\"mvcp/view.html\"><article data-doc=\"sdd\" data-rev=\"1\"><section data-rev=\"1\" data-unit-id=\"todo-fe\"><h3>V-1 列表组件</h3><p>顶部 input + 按钮 + 列表。</p><table><tr><th>组件</th><th>事件</th></tr><tr><td>TodoList</td><td>load/add</td></tr></table><pre>Vue SFC: TodoList.vue</pre><svg width=\"60\" height=\"40\"><rect x=\"5\" y=\"5\" width=\"50\" height=\"10\" fill=\"#fff\" stroke=\"#999\"/></svg><div class=\"card\">UI</div></section></article></body></html>"
},
{
"path": "sdd/mvcp/control.html",
"content": "<!doctype html><html><head><meta charset=\"utf-8\"><title>Control</title><link rel=\"stylesheet\" href=\"../assets/shell.css\"></head><body data-page=\"mvcp/control.html\"><article data-doc=\"sdd\" data-rev=\"1\"><section data-rev=\"1\" data-unit-id=\"todo-be\"><h3>C-1 POST /todos</h3><p>Body: { text }; Resp 201: { id, text, done:false, created_at }</p><table><tr><th>field</th><th>req</th></tr><tr><td>text</td><td>true</td></tr></table><pre>POST /todos</pre><svg width=\"40\" height=\"20\"></svg><div class=\"card\">api</div></section><section data-rev=\"1\" data-unit-id=\"todo-be\"><h3>C-2 GET /todos</h3><p>Resp 200: Todo[]</p><table><tr><td>list</td><td>Todo[]</td></tr></table><pre>GET /todos</pre><svg width=\"40\" height=\"20\"></svg><div class=\"card\">api</div></section></article></body></html>"
},
{
"path": "sdd/mvcp/process.html",
"content": "<!doctype html><html><head><meta charset=\"utf-8\"><title>Process</title><link rel=\"stylesheet\" href=\"../assets/shell.css\"></head><body data-page=\"mvcp/process.html\"><article data-doc=\"sdd\" data-rev=\"1\"><section data-rev=\"1\" data-unit-id=\"todo-be\"><h3>P-1 启动流程</h3><p>node server.js → listen $PORT → ready</p><table><tr><th>step</th><th>action</th></tr><tr><td>1</td><td>spawn</td></tr></table><pre>spawn -> listen -> ready</pre><svg width=\"60\" height=\"20\"><line x1=\"0\" y1=\"10\" x2=\"60\" y2=\"10\" marker-end=\"url(#a)\" stroke-dasharray=\"3 2\"/></svg><div class=\"card\">proc</div></section></article></body></html>"
},
{
"path": "sdd/assets/shell.css",
"content": "/* sdd shell.css placeholder */\nbody { font-family: system-ui; }\n.card { padding: 6px; border: 1px solid #ddd; }\n"
},
{
"path": "sdd/assets/shell.js",
"content": "/* sdd shell.js placeholder */\nconsole.log('[devloop-sdd] shell loaded');\n"
},
{
"path": "sdd/assets/search-index.json",
"content": "{\"version\":\"1\",\"pages\":5,\"entries\":[]}"
},
{
"path": "units.json",
"content": "{\n \"project_id\": \"_placeholder_\",\n \"rev\": 1,\n \"prd_rev\": \"1\",\n \"sdd_rev\": \"1\",\n \"created_at\": \"2026-05-13T10:01:00.000Z\",\n \"l2_rounds\": 0,\n \"l2_budget\": 3,\n \"units\": [\n {\n \"id\": \"todo-db\",\n \"type\": \"db\",\n \"kind\": \"db\",\n \"description\": \"SQLite schema for todos table\",\n \"depends_on\": [],\n \"contract_hash\": \"sha256:0000000000000001\",\n \"status\": \"pending\",\n \"retries\": 0,\n \"retry_budget\": 3\n },\n {\n \"id\": \"todo-be\",\n \"type\": \"be\",\n \"kind\": \"be\",\n \"description\": \"Express API for /todos\",\n \"depends_on\": [\"todo-db\"],\n \"contract_hash\": \"sha256:0000000000000002\",\n \"status\": \"pending\",\n \"retries\": 0,\n \"retry_budget\": 3\n },\n {\n \"id\": \"todo-fe\",\n \"type\": \"fe\",\n \"kind\": \"fe\",\n \"description\": \"Vue list page\",\n \"depends_on\": [\"todo-be\"],\n \"contract_hash\": \"sha256:0000000000000003\",\n \"status\": \"pending\",\n \"retries\": 0,\n \"retry_budget\": 3\n }\n ]\n}\n"
},
{
"path": "integration/spec.json",
"content": "{\n \"rev\": 1,\n \"created_at\": \"2026-05-13T10:01:00.000Z\",\n \"cases\": [\n {\n \"id\": \"case-add-list\",\n \"title\": \"add a todo then list shows it\",\n \"involves\": [\"todo-be\", \"todo-db\"],\n \"steps\": [\n { \"unit\": \"todo-be\", \"call\": \"POST /todos\", \"body\": { \"text\": \"buy milk\" }, \"expect\": { \"status\": 201, \"json\": { \"id\": \"$.id\", \"text\": \"buy milk\" } } },\n { \"unit\": \"todo-be\", \"call\": \"GET /todos\", \"expect\": { \"status\": 200 } }\n ]\n }\n ]\n}\n"
},
{
"path": "history/sdd-rev-001.html",
"content": "<!doctype html><html><head><title>SDD rev 1 snapshot</title></head><body><article data-doc=\"sdd\" data-rev=\"1\"><section data-rev=\"1\"><h3>Snapshot</h3><p>Archive of SDD rev 1, see sdd/ for live version.</p></section></article></body></html>"
},
{
"path": "units/todo-be/spec.json",
"content": "{\n \"unit_id\": \"todo-be\",\n \"kind\": \"be\",\n \"depends_on\": [\"todo-db\"],\n \"description\": \"Express API for /todos\",\n \"acceptance_criteria\": [\n \"POST /todos with text=foo returns 201 with id, text=foo, done=false\",\n \"GET /todos returns array of todos\",\n \"POST /todos with empty body returns 400\"\n ],\n \"contract_hint\": {\n \"exports\": {\n \"http\": [\n { \"method\": \"POST\", \"path\": \"/todos\", \"responses\": { \"201\": \"Todo\", \"400\": \"BadRequest\" } },\n { \"method\": \"GET\", \"path\": \"/todos\", \"responses\": { \"200\": \"Todo[]\" } }\n ]\n }\n }\n}\n"
},
{
"path": "units/todo-db/spec.json",
"content": "{\n \"unit_id\": \"todo-db\",\n \"kind\": \"db\",\n \"depends_on\": [],\n \"description\": \"SQLite schema for todos\",\n \"acceptance_criteria\": [\"schema.sql defines todos table with id/text/done/created_at\"]\n}\n"
},
{
"path": "units/todo-fe/spec.json",
"content": "{\n \"unit_id\": \"todo-fe\",\n \"kind\": \"fe\",\n \"depends_on\": [\"todo-be\"],\n \"description\": \"Vue list page\",\n \"acceptance_criteria\": [\"renders list from GET /todos\", \"calls POST /todos on submit\"]\n}\n"
},
{
"path": "agent-state/architect.json",
"content": "{\"agent\":\"devloop-architect\",\"status\":\"idle\",\"current_step\":6,\"total_steps\":6,\"last_call_id\":\"call-mock-architect\",\"updated_at\":\"2026-05-13T10:01:01.000Z\"}"
},
{
"path": "agent-state/architect-todo.json",
"content": "{\"agent\":\"devloop-architect\",\"call_id\":\"call-mock-architect\",\"created_at\":\"2026-05-13T10:01:00.000Z\",\"items\":[{\"id\":\"step-001\",\"description\":\"bootstrap_sdd_site\",\"status\":\"done\",\"depends_on\":[]},{\"id\":\"step-002\",\"description\":\"write mvcp/model.html\",\"status\":\"done\",\"depends_on\":[\"step-001\"]},{\"id\":\"step-003\",\"description\":\"write mvcp/{view,control,process}.html\",\"status\":\"done\",\"depends_on\":[\"step-002\"]},{\"id\":\"step-004\",\"description\":\"write units.json (3 units, DAG)\",\"status\":\"done\",\"depends_on\":[\"step-003\"]},{\"id\":\"step-005\",\"description\":\"write integration/spec.json\",\"status\":\"done\",\"depends_on\":[\"step-004\"]},{\"id\":\"step-006\",\"description\":\"validate_sdd_consistency + archive\",\"status\":\"done\",\"depends_on\":[\"step-005\"]}],\"current\":null,\"progress_pct\":100}"
}
]
}