mirror of
https://github.com/jparkerweb/plan2code.git
synced 2026-11-16 04:45:33 -08:00
Post one phase-file doc in a build instead of a duplicate task list
AI Assisted
This commit is contained in:
1 parent
d016ba862a
commit
1b9eb2e35b
6 files changed
+17
-35
No files matched your search
@@ -74,7 +74,7 @@ const SHOTS = {
|
||||
},
|
||||
question: { workflow: "plan", posts: ["question"] },
|
||||
doc: { workflow: "plan", posts: ["doc"], tab: "What we've agreed" },
|
||||
build: { workflow: "implement", posts: ["build"], tab: "Phase 3 tasks" },
|
||||
build: { workflow: "implement", posts: ["build"], tab: "phase-3.md" },
|
||||
signoff: { workflow: "implement", posts: ["signoff"] },
|
||||
finish: { workflow: "implement", posts: ["signoff", "finish"] },
|
||||
ask: { workflow: "plan", posts: ["question"], ask: "Where are tasks paged?" },
|
||||
|
||||
@@ -7,18 +7,6 @@
|
||||
"total": 11
|
||||
},
|
||||
"docs": [
|
||||
{
|
||||
"id": "phase",
|
||||
"title": "Phase 3 tasks",
|
||||
"version": 6,
|
||||
"blocks": [
|
||||
{
|
||||
"id": "tasks",
|
||||
"state": "settled",
|
||||
"md": "- [x] **Task 3.1:** Register the /tasks routes plugin\n- [x] **Task 3.2:** Add GET /tasks with cursor paging\n- [x] **Task 3.3:** Add GET /tasks/:id\n- [x] **Task 3.4:** Add POST /tasks with a Zod schema\n- [x] **Task 3.5:** Add PATCH /tasks/:id for status and fields\n- [ ] **Task 3.6:** Add DELETE /tasks/:id as a soft delete\n- [ ] **Task 3.7:** Filter GET /tasks by status and assignee\n- [ ] **Task 3.8:** Return one error shape for 400, 404 and 409\n- [ ] **Task 3.9:** Document the endpoints in openapi.yaml\n- [ ] **Task 3.10:** Write tests for paging, filters and validation\n- [ ] **Task 3.11:** Run the test suite and record the results"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "phasefile",
|
||||
"title": "phase-3.md",
|
||||
|
||||
@@ -8,14 +8,14 @@
|
||||
},
|
||||
"docs": [
|
||||
{
|
||||
"id": "phase",
|
||||
"title": "Phase 3 tasks",
|
||||
"id": "phasefile",
|
||||
"title": "phase-3.md",
|
||||
"version": 12,
|
||||
"blocks": [
|
||||
{
|
||||
"id": "tasks",
|
||||
"id": "body",
|
||||
"state": "settled",
|
||||
"md": "- [x] **Task 3.1:** Register the /tasks routes plugin\n- [x] **Task 3.2:** Add GET /tasks with cursor paging\n- [x] **Task 3.3:** Add GET /tasks/:id\n- [x] **Task 3.4:** Add POST /tasks with a Zod schema\n- [x] **Task 3.5:** Add PATCH /tasks/:id for status and fields\n- [x] **Task 3.6:** Add DELETE /tasks/:id as a soft delete\n- [x] **Task 3.7:** Filter GET /tasks by status and assignee\n- [x] **Task 3.8:** Return one error shape for 400, 404 and 409\n- [x] **Task 3.9:** Document the endpoints in openapi.yaml\n- [x] **Task 3.10:** Write tests for paging, filters and validation\n- [x] **Task 3.11:** Run the test suite and record the results"
|
||||
"md": "# Phase 3: API endpoints\n\n**Status:** Complete\n**Estimated Tasks:** 11\n\n## Tasks\n\n- [x] **Task 3.1:** Register the /tasks routes plugin\n- [x] **Task 3.2:** Add GET /tasks with cursor paging\n- [x] **Task 3.3:** Add GET /tasks/:id\n- [x] **Task 3.4:** Add POST /tasks with a Zod schema\n- [x] **Task 3.5:** Add PATCH /tasks/:id for status and fields\n- [x] **Task 3.6:** Add DELETE /tasks/:id as a soft delete\n- [x] **Task 3.7:** Filter GET /tasks by status and assignee\n- [x] **Task 3.8:** Return one error shape for 400, 404 and 409\n- [x] **Task 3.9:** Document the endpoints in openapi.yaml\n- [x] **Task 3.10:** Write tests for paging, filters and validation\n- [x] **Task 3.11:** Run the test suite and record the results"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -9,13 +9,13 @@
|
||||
},
|
||||
"docs": [
|
||||
{
|
||||
"id": "phase",
|
||||
"title": "Phase 3 tasks",
|
||||
"id": "phasefile",
|
||||
"title": "phase-3.md",
|
||||
"blocks": [
|
||||
{
|
||||
"id": "tasks",
|
||||
"id": "body",
|
||||
"state": "settled",
|
||||
"md": "- [x] **Task 3.1:** Add GET /tasks with cursor paging\n- [x] **Task 3.2:** Add POST /tasks\n- [ ] **Task 3.3:** Add PATCH /tasks/:id\n- [ ] **Task 3.4:** Add DELETE /tasks/:id"
|
||||
"md": "# Phase 3: API endpoints\n\n**Status:** In Progress\n\n## Tasks\n\n- [x] **Task 3.1:** Add GET /tasks with cursor paging\n- [x] **Task 3.2:** Add POST /tasks\n- [ ] **Task 3.3:** Add PATCH /tasks/:id\n- [ ] **Task 3.4:** Add DELETE /tasks/:id"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -452,24 +452,21 @@ test("docs: a doc's version never goes back; the same version again is fine, and
|
||||
|
||||
test("docs: a second phase in one build session goes through as notes/implement.md teaches it", () => {
|
||||
const md = fs.readFileSync(path.join(ROOT, "src", "web-console", "notes", "implement.md"), "utf8");
|
||||
assert.match(md, /A later phase posts the same two docs/);
|
||||
assert.match(md, /A later phase posts the same doc with the new title and file/);
|
||||
assert.match(fs.readFileSync(path.join(ROOT, "src", "web-console", "console-docs.md"), "utf8"), /`version`: moves by itself when content changes and never goes back; leave it out/);
|
||||
const taught = consoleSession(["--workflow", "implement"]);
|
||||
try {
|
||||
// As taught: no version anywhere, and the second phase simply goes through.
|
||||
const phase = (n, md) => ({
|
||||
headline: { stage: `Phase ${n}`, cleared: 0 },
|
||||
docs: [
|
||||
{ id: "phase", title: `Phase ${n} tasks`, blocks: [{ id: "tasks", state: "settled", md }] },
|
||||
{ id: "phasefile", title: `phase-${n}.md`, blocks: [{ id: "body", state: "settled", md }] },
|
||||
],
|
||||
docs: [{ id: "phasefile", title: `phase-${n}.md`, blocks: [{ id: "body", state: "settled", md }] }],
|
||||
});
|
||||
assert.equal(postPatch(taught, phase(1, "- [ ] Task 1.1")).status, 0);
|
||||
assert.equal(postPatch(taught, phase(1, "- [x] Task 1.1")).status, 0);
|
||||
assert.equal(postPatch(taught, phase(2, "- [ ] Task 2.1")).status, 0);
|
||||
assert.deepEqual(
|
||||
readState(taught.session).docs.map((d) => [d.id, d.title, d.version]),
|
||||
[["phase", "Phase 2 tasks", 3], ["phasefile", "phase-2.md", 3]]
|
||||
[["phasefile", "phase-2.md", 3]]
|
||||
);
|
||||
} finally {
|
||||
cli(["stop", "--session", taught.sid, "--force"]);
|
||||
@@ -479,10 +476,7 @@ test("docs: a second phase in one build session goes through as notes/implement.
|
||||
try {
|
||||
const phase = (n, version, md) => ({
|
||||
headline: { stage: `Phase ${n}`, cleared: 0 },
|
||||
docs: [
|
||||
{ id: "phase", title: `Phase ${n} tasks`, version, blocks: [{ id: "tasks", state: "settled", md }] },
|
||||
{ id: "phasefile", title: `phase-${n}.md`, version, blocks: [{ id: "body", state: "settled", md }] },
|
||||
],
|
||||
docs: [{ id: "phasefile", title: `phase-${n}.md`, version, blocks: [{ id: "body", state: "settled", md }] }],
|
||||
});
|
||||
assert.equal(postPatch(s, phase(1, 1, "- [ ] Task 1.1")).status, 0);
|
||||
assert.equal(postPatch(s, phase(1, 2, "- [x] Task 1.1")).status, 0);
|
||||
@@ -492,7 +486,7 @@ test("docs: a second phase in one build session goes through as notes/implement.
|
||||
const docs = readState(s.session).docs;
|
||||
assert.deepEqual(
|
||||
docs.map((d) => [d.id, d.title, d.version]),
|
||||
[["phase", "Phase 2 tasks", 3], ["phasefile", "phase-2.md", 3]]
|
||||
[["phasefile", "phase-2.md", 3]]
|
||||
);
|
||||
} finally {
|
||||
cli(["stop", "--session", s.sid, "--force"]);
|
||||
|
||||
@@ -5,17 +5,17 @@
|
||||
## First post of a phase
|
||||
|
||||
```jsonc
|
||||
{"headline":{"stage":"Phase 3: API layer","cleared":0,"total":9},"docs":[{"id":"phase","title":"Phase 3 tasks","blocks":[{"id":"tasks","file":"specs/<feature>/phase-3.md","select":"tasks"}]},{"id":"phasefile","title":"phase-3.md","blocks":[{"id":"body","file":"specs/<feature>/phase-3.md"}]}],"agent":{"status":"working","activity":"Checking the prerequisites","quietMinutes":15}}
|
||||
{"headline":{"stage":"Phase 3: API layer","cleared":0,"total":9},"docs":[{"id":"phasefile","title":"phase-3.md","blocks":[{"id":"body","file":"specs/<feature>/phase-3.md"}]}],"agent":{"status":"working","activity":"Checking the prerequisites","quietMinutes":15}}
|
||||
```
|
||||
|
||||
`phase` is the task list, `phasefile` the whole file. A later phase posts the same two docs with the new title and file.
|
||||
`phasefile` is the whole file, so its task list is already on the page; no separate tasks doc is posted. A later phase posts the same doc with the new title and file.
|
||||
|
||||
## After every task
|
||||
|
||||
With the checkbox write:
|
||||
|
||||
```jsonc
|
||||
{"headline":{"cleared":4},"docs":[{"id":"phase","refresh":true},{"id":"phasefile","refresh":true}],"agent":{"activity":"Task 5 of 9: the rate limiter"}}
|
||||
{"headline":{"cleared":4},"docs":[{"id":"phasefile","refresh":true}],"agent":{"activity":"Task 5 of 9: the rate limiter"}}
|
||||
```
|
||||
|
||||
The Phase Completion Summary lands in `phasefile` the same way. Then the `chat` check.
|
||||
|
||||
Reference in new issue
Block a user