dsh-plan-steps 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +1 -1
- package/README.md +1 -1
- package/docs/DETAIL.md +1 -1
- package/index.js +3 -0
- package/package.json +1 -1
package/README.en.md
CHANGED
|
@@ -16,7 +16,7 @@ plugin is a rewrite against DSH's event and slot model, not a port.
|
|
|
16
16
|
|
|
17
17
|
| Piece | Effect |
|
|
18
18
|
| --- | --- |
|
|
19
|
-
| `plan_write` | Records a two-level plan: `level` 0 phases, `level` 1 sub-steps, an optional stable `step_id`, exactly one current item. A rewrite is checked for continuity: an existing id is never dropped, the current item is never removed or moved back to pending, and completed history keeps its position. |
|
|
19
|
+
| `plan_write` | Records a two-level plan: `level` 0 phases, `level` 1 sub-steps, an optional stable `step_id`, exactly one current item. A rewrite is checked for continuity: an existing id is never dropped, the current item is never removed or moved back to pending, and completed history keeps its position — once every item is completed the plan is history and a new one may replace it. |
|
|
20
20
|
| `complete_step` | Signs the current `in_progress` item off, appends the advanced list as a `todo/write` snapshot (the panel follows), and names the next step. A phase signs off only after its sub-steps. |
|
|
21
21
|
| guard | Refuses a `plan_write` / `todo_write` that turns an item `completed` while the host still has it open. |
|
|
22
22
|
| turn hold | Steers the turn back when it is about to close with open items — once per turn. |
|
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
| 部件 | 作用 |
|
|
17
17
|
| --- | --- |
|
|
18
|
-
| `plan_write` | 记录两级计划:`level` 0 是阶段,`level` 1 是它的子步骤,每项可带稳定 `step_id`,全表只有一个当前项。重写时执行连续性校验:已有的 id
|
|
18
|
+
| `plan_write` | 记录两级计划:`level` 0 是阶段,`level` 1 是它的子步骤,每项可带稳定 `step_id`,全表只有一个当前项。重写时执行连续性校验:已有的 id 不能丢、当前项不能被删或降级、已完成项保持原位;上一份计划全部完成后可以直接写新计划。 |
|
|
19
19
|
| `complete_step` | 签掉当前 `in_progress` 那一项,宿主推进列表并写入 `todo/write` 快照(面板随之更新),再把下一步告诉你。阶段必须等子步骤全部完成后才能签。 |
|
|
20
20
|
| 守卫 | 列表里还开着的项被 `plan_write` / `todo_write` 直接标成 `completed` 时拒绝。 |
|
|
21
21
|
| 收尾拉回 | 轮末列表还有未完成项时,用 `agent.steer()` 把这一轮拉回来——每轮最多一次。 |
|
package/docs/DETAIL.md
CHANGED
|
@@ -84,7 +84,7 @@ phase's first sub-step), serial validation (single current item, phase made
|
|
|
84
84
|
current too early, pending work with no current item), call replay, step
|
|
85
85
|
identity, the stored-state parser, and the state block — plus the four
|
|
86
86
|
continuity rules a rewrite must respect (id preserved, current item kept and not
|
|
87
|
-
regressed, completed history in place, first write and additive replan allowed).
|
|
87
|
+
regressed, completed history in place, first write and additive replan allowed, and a fully completed plan replaced outright).
|
|
88
88
|
|
|
89
89
|
## Verification
|
|
90
90
|
|
package/index.js
CHANGED
|
@@ -407,6 +407,9 @@ function findSame(item, list) {
|
|
|
407
407
|
*/
|
|
408
408
|
function continuityProblem(previous, next) {
|
|
409
409
|
if (previous === null || previous.length === 0) return null
|
|
410
|
+
// A finished plan is history, not state: once every item is completed there is
|
|
411
|
+
// no completion left to keep attached, so a new plan may replace it outright.
|
|
412
|
+
if (previous.every((item) => item.status === 'completed')) return null
|
|
410
413
|
for (const item of previous) {
|
|
411
414
|
if (item.stepId === undefined) continue
|
|
412
415
|
if (next.some((candidate) => candidate.stepId === item.stepId)) continue
|