agent-step-gate 0.3.0 โ 0.3.1
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.md +32 -0
- package/SKILL.md +0 -3
- package/Weaver.md +121 -116
- package/package.json +4 -10
- package/ARCHITECTURE.md +0 -393
package/README.md
CHANGED
|
@@ -13,6 +13,38 @@ It only maintains an external execution ledger and verifies that planned steps h
|
|
|
13
13
|
|
|
14
14
|
---
|
|
15
15
|
|
|
16
|
+
## ๐ Quick Start
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
# Install globally
|
|
20
|
+
npm install -g agent-step-gate
|
|
21
|
+
|
|
22
|
+
# Create a task with steps
|
|
23
|
+
step-gate start-plan '{
|
|
24
|
+
"title":"Refactor auth module",
|
|
25
|
+
"steps":[
|
|
26
|
+
{"id":"extract","title":"Extract middleware","dependsOn":[]},
|
|
27
|
+
{"id":"jwt","title":"Add JWT validation","dependsOn":[]},
|
|
28
|
+
{"id":"routes","title":"Update routes","dependsOn":["extract","jwt"]},
|
|
29
|
+
{"id":"test","title":"Write tests","dependsOn":["routes"]}
|
|
30
|
+
]
|
|
31
|
+
}'
|
|
32
|
+
# โ Returns taskId + stepKeys for unlocked steps
|
|
33
|
+
|
|
34
|
+
# Complete a step (unlocks downstream)
|
|
35
|
+
step-gate checkpoint '{"taskId":"tsk_XXX","stepId":"tsk_XXX_extract","stepKey":"K8F2QZ"}'
|
|
36
|
+
# โ Returns nextSteps + nextStepKeys
|
|
37
|
+
|
|
38
|
+
# Finalize when all steps are done
|
|
39
|
+
step-gate finalize '{"taskId":"tsk_XXX","taskKey":"A1B2C3"}'
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
**One interaction = One Task.** Create a task, checkpoint each step, finalize. The external ledger ensures nothing is skipped.
|
|
43
|
+
|
|
44
|
+
For multi-session projects, see [Program mode](#program-level-usage). For multi-agent orchestration, see [Weaver.md](Weaver.md).
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
16
48
|
## โ Why
|
|
17
49
|
|
|
18
50
|
Long-context agents are capable, but they often miss steps in long-running tasks.
|
package/SKILL.md
CHANGED
|
@@ -185,6 +185,3 @@ The CLI auto-discovers the session from binding files. No manual session managem
|
|
|
185
185
|
- `Weaver.md` โ Multi-agent orchestration: how a Main Agent spawns Sub Agents, injects
|
|
186
186
|
taskId + stepKey, and verifies returned taskKeys. Read this before orchestrating
|
|
187
187
|
parallel Sub Agents.
|
|
188
|
-
- `ARCHITECTURE.md` โ Full architecture: 4-layer model, 7 DB tables, 5 credential types,
|
|
189
|
-
12 CLI commands, 20+ core functions
|
|
190
|
-
- `docs/security-stress-test-report.md` โ Security audit: 9 issues, all resolved
|
package/Weaver.md
CHANGED
|
@@ -1,140 +1,145 @@
|
|
|
1
|
-
# Weaver โ
|
|
1
|
+
# Weaver โ Multi-Agent Orchestration Protocol
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Role model
|
|
4
4
|
|
|
5
5
|
```
|
|
6
|
-
Main Agent (
|
|
7
|
-
โ
|
|
8
|
-
โ
|
|
6
|
+
Main Agent (orchestrator)
|
|
7
|
+
โ Only three jobs: dispatch, verify, advance
|
|
8
|
+
โ Never writes code, never executes steps
|
|
9
9
|
โ
|
|
10
|
-
โโโ Sub Agent A
|
|
11
|
-
โโโ Sub Agent B
|
|
12
|
-
โโโ Sub Agent C
|
|
10
|
+
โโโ Sub Agent A Knows: taskId + taskGoal + its stepKeys
|
|
11
|
+
โโโ Sub Agent B Does NOT know: full DAG, other tasks, Node/Program
|
|
12
|
+
โโโ Sub Agent C Does NOT know: validation logic (the Gate handles it)
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
The Main Agent injects precisely what each Sub Agent needs. No more, no less.
|
|
16
|
+
|
|
17
|
+
## Protocol: what gets passed
|
|
18
|
+
|
|
19
|
+
### Main Agent โ Sub Agent (dispatch)
|
|
20
|
+
|
|
21
|
+
```json
|
|
22
|
+
{
|
|
23
|
+
"taskId": "tsk_XXXXXX",
|
|
24
|
+
"taskGoal": "Extract auth middleware into a standalone module",
|
|
25
|
+
"stepKeys": {
|
|
26
|
+
"tsk_XXXXXX_extract": "K8F2QZ"
|
|
27
|
+
},
|
|
28
|
+
"constraints": [
|
|
29
|
+
"Only work on this task's scope",
|
|
30
|
+
"Run step-gate checkpoint after each step",
|
|
31
|
+
"Return the taskKey when all steps are done"
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Critical: `stepKeys` contains the keys for currently-unlocked steps. The Sub Agent
|
|
37
|
+
needs these to call `checkpoint`. Without them, it can't advance. The Main Agent
|
|
38
|
+
gets them from the `start-plan` or `checkpoint` response.
|
|
16
39
|
|
|
17
|
-
|
|
40
|
+
### Sub Agent โ Main Agent (return)
|
|
18
41
|
|
|
42
|
+
```json
|
|
43
|
+
{
|
|
44
|
+
"taskId": "tsk_XXXXXX",
|
|
45
|
+
"taskKey": "A1B2C3",
|
|
46
|
+
"summary": "Extracted auth middleware to src/middleware/auth.ts",
|
|
47
|
+
"artifacts": ["src/middleware/auth.ts", "src/middleware/index.ts"]
|
|
48
|
+
}
|
|
19
49
|
```
|
|
20
|
-
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
21
|
-
Phase 0 โ ่งๅ
|
|
22
|
-
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
23
|
-
Main Agent:
|
|
24
|
-
program init โ ๆๅ Node
|
|
25
|
-
reconcile โ ๆฅๅธธ่ฏๆญ
|
|
26
50
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
36
|
-
Phase 2 โ ๆดพๅ
|
|
37
|
-
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
38
|
-
Main Agent โ Sub Agent:
|
|
39
|
-
{
|
|
40
|
-
"taskId": "tsk_XXX",
|
|
41
|
-
"taskGoal": "ๆฝ็ฆป่ฎค่ฏไธญ้ดไปถ",
|
|
42
|
-
"constraints": ["ๅชๅค็ๆฌTask่ๅด", "ๅฎๆๅ่ฐcheckpoint"]
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
Sub Agent ๅจๅไธๅทฅไฝ็ฎๅฝๅฏๅจ:
|
|
46
|
-
โ ensureSession() ่ชๅจไป .step-gate/bindings/ ๅ็ฐ session
|
|
47
|
-
โ ๆ ้ๆๅจไผ sessionId
|
|
48
|
-
|
|
49
|
-
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
50
|
-
Phase 3 โ Sub Agent ๆง่กๅพช็ฏ
|
|
51
|
-
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
52
|
-
Sub Agent:
|
|
53
|
-
current(taskId)
|
|
54
|
-
โ { currentSteps, stepKeys }
|
|
55
|
-
|
|
56
|
-
for each step:
|
|
57
|
-
ๆง่ก step
|
|
58
|
-
checkpoint(taskId, stepId, stepKey)
|
|
59
|
-
โ { nextSteps, nextStepKeys }
|
|
60
|
-
โ ๆ { allStepsCompleted: true, taskKey }
|
|
61
|
-
|
|
62
|
-
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
63
|
-
Phase 4 โ ไบคๅๅญ่ฏ
|
|
64
|
-
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
65
|
-
Sub Agent โ Main Agent:
|
|
66
|
-
{
|
|
67
|
-
"taskId": "tsk_XXX",
|
|
68
|
-
"taskKey": "A1B2C3",
|
|
69
|
-
"summary": "ๅฎๆ่ฎค่ฏไธญ้ดไปถๆฝ็ฆป",
|
|
70
|
-
"artifacts": ["src/middleware/auth.ts"]
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
74
|
-
Phase 5 โ Main Agent ๆ ก้ช + ่ชๅจๆจ่ฟ
|
|
75
|
-
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
51
|
+
If the Sub Agent failed to complete all steps, it returns the current step it's
|
|
52
|
+
stuck on โ the Main Agent can re-dispatch or reassign.
|
|
53
|
+
|
|
54
|
+
## Full lifecycle
|
|
55
|
+
|
|
56
|
+
### Phase 1 โ Plan and create
|
|
57
|
+
|
|
58
|
+
```
|
|
76
59
|
Main Agent:
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
โ ่ฟๅ { ok: true, level, ... }
|
|
81
|
-
โ level="task": Node ่ฟๆๆชๅฎๆ็ Task๏ผ็ปง็ปญๆดพๅ
|
|
82
|
-
โ level="node": Node ๅฎๆ! nodeKey ่ฟๅ๏ผ่ชๅจๆจ่ฟ
|
|
83
|
-
โ level="program": ๅ
จ้จ Node ๅฎๆ! ๆถๅทฅ
|
|
84
|
-
โ Sub Agent ้ๆพ
|
|
85
|
-
|
|
86
|
-
โ ไธ้่ฟ:
|
|
87
|
-
โ ่ฟๅ { actualStatus, completedSteps, missingSteps,
|
|
88
|
-
currentStepId, stepKey }
|
|
89
|
-
โ Main Agent ๆ็ๅฎ่ดฆๆฌๅๅ Sub Agent:
|
|
90
|
-
"ไฝ ็ TaskKey ๆช้่ฟ Gate ๆ ก้ชใ
|
|
91
|
-
ๅทฒๅฎๆ: step_001, step_002
|
|
92
|
-
็ผบๅคฑ: step_003, step_004
|
|
93
|
-
ๅฝๅๅบ็ปง็ปญ step_003๏ผStepKey: SK_REAL33"
|
|
94
|
-
โ Sub Agent ไป currentStepId ็ปง็ปญ checkpoint
|
|
95
|
-
โ ไฟฎๅฎ้ๆฐ finalize
|
|
96
|
-
|
|
97
|
-
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
98
|
-
Phase 6 โ ไธไธไธช Node (่ชๅจ)
|
|
99
|
-
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
100
|
-
finalize ่ฟๅ level="node" ๆถ๏ผMain Agent:
|
|
101
|
-
program status โ ๆพไธไธไธช ready node
|
|
102
|
-
program start <next-node>
|
|
103
|
-
โ ๅๅปบๆฐ Task โ ๆดพๅ โ ๅพช็ฏ
|
|
60
|
+
start-plan โ creates Task with DAG steps
|
|
61
|
+
Receives: taskId + currentSteps + stepKeys (for unlocked steps)
|
|
62
|
+
```
|
|
104
63
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
ๆถๅทฅ
|
|
64
|
+
### Phase 2 โ Dispatch to Sub Agent
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
Main Agent spawns Sub Agent with the injection payload above.
|
|
68
|
+
Sub Agent auto-discovers session from .step-gate/bindings/.
|
|
111
69
|
```
|
|
112
70
|
|
|
113
|
-
|
|
71
|
+
### Phase 3 โ Sub Agent executes
|
|
114
72
|
|
|
115
|
-
|
|
73
|
+
```
|
|
74
|
+
Sub Agent loop:
|
|
75
|
+
1. Read stepKey from the injected payload (or checkpoint response)
|
|
76
|
+
2. Execute the step
|
|
77
|
+
3. step-gate checkpoint '{"taskId":"...","stepId":"...","stepKey":"..."}'
|
|
78
|
+
4. Response gives nextSteps + nextStepKeys (if deps satisfied)
|
|
79
|
+
OR allStepsCompleted: true + taskKey (if this was the last step)
|
|
80
|
+
```
|
|
116
81
|
|
|
117
|
-
|
|
82
|
+
If a merge point hasn't been reached yet (parallel branches), `nextSteps` is
|
|
83
|
+
empty. The Sub Agent must wait for other branches to complete before the merge
|
|
84
|
+
step unlocks.
|
|
118
85
|
|
|
119
|
-
|
|
120
|
-
- taskId ็็ปๆๅซไน
|
|
121
|
-
- ๅฎๆด็ DAG
|
|
122
|
-
- ๅๅ Task ๆฏไปไน
|
|
123
|
-
- Node/Program ๅ
จๅฑ
|
|
124
|
-
- ้ช่ฏ้ป่พ๏ผ็ณป็ป่ชๅทฑๆ ก้ช๏ผ
|
|
86
|
+
### Phase 4 โ Sub Agent returns
|
|
125
87
|
|
|
126
|
-
|
|
88
|
+
```
|
|
89
|
+
Sub Agent โ Main Agent: { taskId, taskKey, summary, artifacts }
|
|
90
|
+
Main Agent: step-gate finalize '{"taskId":"...","taskKey":"..."}'
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Phase 5 โ Verify and propagate
|
|
127
94
|
|
|
128
|
-
|
|
95
|
+
```
|
|
96
|
+
finalize returns:
|
|
97
|
+
{ level: "task" } โ Node has more tasks, dispatch next Sub Agent
|
|
98
|
+
{ level: "node" } โ Node complete, auto-generated nodeKey returned
|
|
99
|
+
{ level: "program" } โ All nodes done, program complete
|
|
100
|
+
|
|
101
|
+
If finalize REJECTS:
|
|
102
|
+
{ accepted: false, pendingSteps: [...] }
|
|
103
|
+
โ Sub Agent missed steps. Send it the pendingSteps list, continue checkpointing.
|
|
104
|
+
```
|
|
129
105
|
|
|
130
|
-
|
|
106
|
+
### Phase 6 โ Next node
|
|
131
107
|
|
|
132
108
|
```
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
109
|
+
When level="node", Main Agent:
|
|
110
|
+
program status โ find next ready node
|
|
111
|
+
program start <next-node>
|
|
112
|
+
โ start-plan โ dispatch โ repeat
|
|
137
113
|
```
|
|
138
114
|
|
|
139
|
-
|
|
140
|
-
|
|
115
|
+
## Key design rules
|
|
116
|
+
|
|
117
|
+
1. **Sub Agent never sees the full DAG.** It only knows the steps it's been given
|
|
118
|
+
keys for. This prevents hallucinated dependencies and keeps context lean.
|
|
119
|
+
|
|
120
|
+
2. **Main Agent only calls `finalize`.** It doesn't need to inspect execution
|
|
121
|
+
traces. The taskKey is a cryptographic proof โ it either matches or it doesn't.
|
|
122
|
+
|
|
123
|
+
3. **Keys are single-use and appear once.** The Sub Agent captures them from the
|
|
124
|
+
checkpoint response. The `current` command does NOT return keys. If a key is
|
|
125
|
+
lost, the task must be cancelled and rebuilt with skipKey.
|
|
126
|
+
|
|
127
|
+
4. **SkipKey recovery.** If a Sub Agent dies mid-task, the Main Agent rebuilds:
|
|
128
|
+
```
|
|
129
|
+
cancel-task โ start-plan (with skipKey + skipTaskId for completed steps)
|
|
130
|
+
```
|
|
131
|
+
Completed steps are marked `skipped`, remaining steps get fresh keys.
|
|
132
|
+
|
|
133
|
+
5. **Pure Task mode.** When Program/Node layers aren't needed, just use:
|
|
134
|
+
```
|
|
135
|
+
start-plan โ checkpoint ร N โ finalize
|
|
136
|
+
```
|
|
137
|
+
The Stop Hook checks for unfinalized tasks at session end.
|
|
138
|
+
|
|
139
|
+
## Progressive disclosure
|
|
140
|
+
|
|
141
|
+
```
|
|
142
|
+
SKILL.md โ All agents. CLI commands + rules.
|
|
143
|
+
Weaver.md โ Main Agent only. How to dispatch and verify Sub Agents.
|
|
144
|
+
CLI + SQLite โ The Gate itself. Agents don't read this.
|
|
145
|
+
```
|
package/package.json
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-step-gate",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.3.1",
|
|
4
|
+
"description": "External cryptographic step ledger for long-running multi-agent orchestration",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "dist/index.js",
|
|
7
6
|
"bin": {
|
|
8
7
|
"step-gate": "dist/cli.js"
|
|
9
8
|
},
|
|
@@ -22,12 +21,10 @@
|
|
|
22
21
|
"dist/",
|
|
23
22
|
"scripts/",
|
|
24
23
|
"SKILL.md",
|
|
25
|
-
"Weaver.md"
|
|
26
|
-
"ARCHITECTURE.md"
|
|
24
|
+
"Weaver.md"
|
|
27
25
|
],
|
|
28
26
|
"license": "MIT",
|
|
29
27
|
"dependencies": {
|
|
30
|
-
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
31
28
|
"better-sqlite3": "^11.0.0",
|
|
32
29
|
"zod": "^4.0"
|
|
33
30
|
},
|
|
@@ -40,9 +37,6 @@
|
|
|
40
37
|
"scripts": {
|
|
41
38
|
"build": "tsc",
|
|
42
39
|
"dev": "tsc --watch",
|
|
43
|
-
"
|
|
44
|
-
"cli": "node dist/cli.js",
|
|
45
|
-
"test": "vitest run",
|
|
46
|
-
"test:watch": "vitest"
|
|
40
|
+
"cli": "node dist/cli.js"
|
|
47
41
|
}
|
|
48
42
|
}
|
package/ARCHITECTURE.md
DELETED
|
@@ -1,393 +0,0 @@
|
|
|
1
|
-
# Agent Step Gate โ ๅฎๆดๆถๆๆๆกฃ
|
|
2
|
-
|
|
3
|
-
**็ๆฌ**: 0.3.0 | **ๆฅๆ**: 2026-05-30 | **ๆต่ฏ**: 116/116
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## 1. ๅๅฑๆถๆ
|
|
8
|
-
|
|
9
|
-
```
|
|
10
|
-
Program (pgm_XXXXXX) โ ่ทจ Session ๅคง่ฎกๅ
|
|
11
|
-
โโ Node (pg-xxx) โ ไธไธช Session ็ๅทฅไฝๅๅ
|
|
12
|
-
โโ Task (tsk_XXXXXX) โ ไธไธช DAG ่ฎกๅ
|
|
13
|
-
โโ Step โ ๆๅฐๆง่กๅๅ
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
ๆฏๅฑ้ฝๆๅฏนๅบ็ๅฎๆๅญ่ฏ๏ผ
|
|
17
|
-
```
|
|
18
|
-
stepKey โโโ taskKey โโโ nodeKey โโโ program (่ชๆฃ)
|
|
19
|
-
(ๅบ็คบ) (ๅบ็คบ) (ๆถๆฎ) (่ชๅจ)
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
### ่ชๅบๅไธไผ ๆญ
|
|
23
|
-
|
|
24
|
-
`finalize` ๅฝไปคไธๆฌก่ฐ็จ๏ผ่ชๅจ้ๅฑไธๆตฎ๏ผ
|
|
25
|
-
|
|
26
|
-
```
|
|
27
|
-
finalize(taskKey)
|
|
28
|
-
โ task completed
|
|
29
|
-
โ ๆฃๆฅ: ๅ node ๅ
จ้จ task completed?
|
|
30
|
-
โ ๆฏ โ ็ๆ nodeKey โ node completed
|
|
31
|
-
โ ๆฃๆฅ: ๅ program ๅ
จ้จ node completed?
|
|
32
|
-
โ ๆฏ โ program completed
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
Agent ไธ้่ฆๅคๆญๅฑ็บงโโ็ณป็ป่ชๅทฑ็ฅ้่ฏฅไผ ๆญๅฐๅชใ
|
|
36
|
-
|
|
37
|
-
---
|
|
38
|
-
|
|
39
|
-
## 2. ๆฐๆฎๅบ โ 7 ๅผ ่กจ
|
|
40
|
-
|
|
41
|
-
### programs
|
|
42
|
-
```sql
|
|
43
|
-
program_id TEXT PK -- pgm_XXXXXX
|
|
44
|
-
title TEXT
|
|
45
|
-
status TEXT -- active | completed
|
|
46
|
-
total_nodes INTEGER
|
|
47
|
-
created_at / updated_at
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
### program_nodes
|
|
51
|
-
```sql
|
|
52
|
-
node_id TEXT PK -- user-defined or pg_xxx_N
|
|
53
|
-
program_id TEXT FK
|
|
54
|
-
title / description / order_index
|
|
55
|
-
status TEXT -- pending | in_progress | completed
|
|
56
|
-
session_id TEXT
|
|
57
|
-
node_key_hash TEXT -- SHA-256(6-char nodeKey), system-generated
|
|
58
|
-
completed_at / created_at
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
### sessions
|
|
62
|
-
```sql
|
|
63
|
-
session_id TEXT PK -- ses_XXXXXX
|
|
64
|
-
session_secret_hash TEXT -- SHA-256(6-char)
|
|
65
|
-
recovery_token_hash TEXT -- SHA-256(6-char)
|
|
66
|
-
title / workspace
|
|
67
|
-
program_id / program_node_id
|
|
68
|
-
status TEXT -- active | completed | abandoned
|
|
69
|
-
created_by_cli / created_at / updated_at
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
### cli_instances
|
|
73
|
-
```sql
|
|
74
|
-
cli_instance_id TEXT PK -- cli_XXXXXX
|
|
75
|
-
session_id / hostname / pid / workspace
|
|
76
|
-
status TEXT -- active | dead | detached
|
|
77
|
-
created_at / last_seen_at
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
### tasks
|
|
81
|
-
```sql
|
|
82
|
-
id TEXT PK -- tsk_XXXXXX
|
|
83
|
-
title / status -- active | completed | cancelled
|
|
84
|
-
current_index / total_steps
|
|
85
|
-
final_key_hash TEXT -- SHA-256(taskKey)
|
|
86
|
-
session_id TEXT FK
|
|
87
|
-
created_at / updated_at
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
### steps
|
|
91
|
-
```sql
|
|
92
|
-
id TEXT PK -- {taskId}_{nodeId}
|
|
93
|
-
task_id / parent_path / title / path
|
|
94
|
-
order_index / depends_on (JSON)
|
|
95
|
-
status TEXT -- pending | current | completed | skipped
|
|
96
|
-
step_key_hash TEXT -- SHA-256(stepKey), ๅฎๆๅไฟ็ไธบๆฐธไน
ๅญ่ฏ
|
|
97
|
-
completed_at / created_at
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
### events
|
|
101
|
-
```sql
|
|
102
|
-
id / task_id / step_id
|
|
103
|
-
event_type TEXT -- plan_created | step_activated | step_completed
|
|
104
|
-
-- all_steps_completed | task_finalized | task_cancelled
|
|
105
|
-
-- skip_key_consumed
|
|
106
|
-
payload / created_at
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
---
|
|
110
|
-
|
|
111
|
-
## 3. ๅฎๅ
จๆจกๅ โ 5 ็งๅญ่ฏ
|
|
112
|
-
|
|
113
|
-
| ๅญ่ฏ | ้ฟๅบฆ | ็จ้ | ็ๆ่
| ้ช่ฏๆนๅผ | ็ๅฝๅจๆ |
|
|
114
|
-
|------|------|------|--------|---------|---------|
|
|
115
|
-
| **stepKey** | 6ไฝ | ่ฏๆๅไธช step ๅฎๆ | ็ณป็ป(plan/checkpoint) | SHA-256 hash ๅน้
| ไธๆฌกๆง๏ผcheckpoint ๅๆถ่ |
|
|
116
|
-
| **taskKey** | 6ไฝ | ่ฏๆๅ
จ้จ step ๅฎๆ | ็ณป็ป(ๆๅไธๆญฅ checkpoint) | SHA-256 hash ๅน้
| ไธๆฌกๆง๏ผfinalize ๅๆถ่ |
|
|
117
|
-
| **nodeKey** | 6ไฝ | Node ๅฎๆๅญ่ฏ(ๆถๆฎ) | ็ณป็ป(finalize ่ชๅจไผ ๆญ) | SHA-256 hash ๅญ DB | ไฝไธบๅฎๆๅญ่ฏ่ฟๅ็ป Agent |
|
|
118
|
-
| **sessionSecret** | 6ไฝ | Session ่บซไปฝ่ฎค่ฏ | ็ณป็ป(createSession) | SHA-256 hash ๅน้
| Session ็ๅฝๅจๆ |
|
|
119
|
-
| **recoveryToken** | 6ไฝ | ๅดฉๆบๆขๅค + ็ฎก็ๆไฝ | ็ณป็ป(createSession) | SHA-256 hash ๅน้
| Session ็ๅฝๅจๆ |
|
|
120
|
-
|
|
121
|
-
### ้็ฆป่งๅ
|
|
122
|
-
- Task ๅๆไฝ๏ผsession_id ๅๅผบๅถ่ฟๆปค
|
|
123
|
-
- cancel-task๏ผๅฟ
้กปๅ session๏ผๆๅบ็คบ recoveryToken (--admin)
|
|
124
|
-
- checkpoint ๅๅญๆง๏ผ`WHERE status='current' + affected rows` ้ฒๅๆถ่ดน
|
|
125
|
-
- stepKey ไธๆฌกๆง๏ผkey_hash ไฟ็ไฝๆฐธไน
ๅญ่ฏ๏ผไฝ step ๅช่ฝ checkpoint ไธๆฌก
|
|
126
|
-
|
|
127
|
-
### skipKey ้ช่ฏ (ไธญๆญๆขๅค)
|
|
128
|
-
- ๆง task ็ completed step ๅฏไฝ skipKey ่ทณ่ฟๆฐ task ็้ๅคๆญฅ้ชค
|
|
129
|
-
- `verifySkipKey()` ๆฃๆฅ๏ผhash ๅน้
+ status='completed' + events ่กจๆ `skip_key_consumed`
|
|
130
|
-
- ้ช่ฏ้่ฟๅ็ซๅณๅๅ
ฅ `skip_key_consumed` ไบไปถโโ็กฎไฟไธๆฌกๆงไฝฟ็จ
|
|
131
|
-
- ่ทณ่ฟๆญฅ้ชคๆ ่ฎฐไธบ `skipped`๏ผ้ `completed`๏ผ๏ผไฟ็ๆบฏๆบ
|
|
132
|
-
|
|
133
|
-
---
|
|
134
|
-
|
|
135
|
-
## 4. DAG ๅผๆ
|
|
136
|
-
|
|
137
|
-
### ่พๅ
ฅๆ ผๅผ
|
|
138
|
-
```json
|
|
139
|
-
{
|
|
140
|
-
"title": "Plan",
|
|
141
|
-
"steps": [
|
|
142
|
-
{"id":"a","title":"A","dependsOn":[]},
|
|
143
|
-
{"id":"b","title":"B","dependsOn":["a"]},
|
|
144
|
-
{"id":"c","title":"C","dependsOn":[],"skipKey":"OLD","skipTaskId":"tsk_OLD"}
|
|
145
|
-
]
|
|
146
|
-
}
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
### ๅฑๅผ่งๅ
|
|
150
|
-
1. `dependsOn: []` โ ๅนถ่ก่ตท็น๏ผๅๅงๅณๆฟๆดป
|
|
151
|
-
2. `dependsOn: undefined` โ ่ชๅจไธฒ่ก๏ผไพ่ตๅไธไธชๅถๅญ
|
|
152
|
-
3. `dependsOn: ["b","c"]` โ b ๅ c ้ฝๅฎๆๅๆ่งฃ้
|
|
153
|
-
4. `skipKey + skipTaskId` โ ้ช่ฏ้่ฟๅๆ ่ฎฐ `skipped`
|
|
154
|
-
5. ๅตๅฅ children โ ้ๅฝๅฑๅผไธบๅถๅญ่็น
|
|
155
|
-
|
|
156
|
-
### ่งฃ้็ฎๆณ
|
|
157
|
-
```
|
|
158
|
-
checkpoint(stepX):
|
|
159
|
-
1. ๆ ่ฎฐ stepX = completed (ไฟ็ key_hash)
|
|
160
|
-
2. ๆซๆ pending steps๏ผ
|
|
161
|
-
dependsOn ๅ
จ้จ completed/skipped โ ๆ ่ฎฐ current๏ผ็ๆ key
|
|
162
|
-
3. ๆ ๆฐ่งฃ้ + ๅ
จ้จ completed/skipped โ ็ๆ taskKey
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
---
|
|
166
|
-
|
|
167
|
-
## 5. CLI ๅฝไปคๅ
จ้ (12 ไธช)
|
|
168
|
-
|
|
169
|
-
### Task ็บง
|
|
170
|
-
| ๅฝไปค | ่พๅ
ฅ | ่พๅบ |
|
|
171
|
-
|------|------|------|
|
|
172
|
-
| `start-plan '<json>'` | title + steps[] | taskId, session, totalSteps, currentSteps, stepKeys |
|
|
173
|
-
| `checkpoint '<json>'` | taskId + stepId + stepKey | completedStep, nextSteps, nextStepKeys, taskKey |
|
|
174
|
-
| `current '<json>'` | taskId | status, totalSteps, completedSteps, currentSteps |
|
|
175
|
-
| `finalize '<json>'` | taskId + taskKey | level(task/node/program), nodeKey(if), program(if) |
|
|
176
|
-
| `cancel-task '<json>'` | taskId | ok / error(NO_SESSION) |
|
|
177
|
-
| `active-task` | โ | activeTasks[] (session-filtered) |
|
|
178
|
-
| `active-task --all` | โ | activeTasks[] (่ทจ session) |
|
|
179
|
-
|
|
180
|
-
### Program ็บง
|
|
181
|
-
| ๅฝไปค | ่พๅ
ฅ | ่พๅบ |
|
|
182
|
-
|------|------|------|
|
|
183
|
-
| `program init '<json>'` | title + nodes[] | programId, totalNodes, nodes |
|
|
184
|
-
| `program status '<json>'` | programId | programId, title, nodes[] |
|
|
185
|
-
| `program ready '<json>'` | programId | readyNodes[] |
|
|
186
|
-
| `program start '<json>'` | programId + nodeId | ok, nodeId, sessionId |
|
|
187
|
-
| `program finalize '<json>'` | programId | ok, pending[] |
|
|
188
|
-
|
|
189
|
-
### Session ็ปๅฎๆนๅผ
|
|
190
|
-
- `--session-file <path>` โ ๆพๅผๆๅฎ session ๆไปถ
|
|
191
|
-
- `--binding-file <path>` โ ้่ฟ binding ๆไปถ้ดๆฅๆๅฎ
|
|
192
|
-
- `STEP_GATE_SESSION_FILE` / `STEP_GATE_BINDING_FILE` ็ฏๅขๅ้
|
|
193
|
-
- ่ชๅจๅ็ฐ `.step-gate/bindings/` ไธญๆๆฐ็ binding๏ผๅ้๏ผ
|
|
194
|
-
|
|
195
|
-
### Admin ๆจกๅผ
|
|
196
|
-
- `cancel-task --admin --recovery-token <token>` โ ่ทจ session ๅๆถ
|
|
197
|
-
|
|
198
|
-
---
|
|
199
|
-
|
|
200
|
-
## 6. ๆ ธๅฟๅฝๆฐ (20+)
|
|
201
|
-
|
|
202
|
-
### src/core/plan.ts
|
|
203
|
-
| ๅฝๆฐ | ไฝ็จ |
|
|
204
|
-
|------|------|
|
|
205
|
-
| `flattenPlan(nodes, taskId) โ LeafStep[]` | ๅตๅฅๅฑๅผ + DAG ไพ่ต่งฃๆ |
|
|
206
|
-
|
|
207
|
-
### src/core/keys.ts
|
|
208
|
-
| ๅฝๆฐ | ไฝ็จ |
|
|
209
|
-
|------|------|
|
|
210
|
-
| `randomCode(length) โ string` | [A-Z0-9] ้ๆบ็ |
|
|
211
|
-
| `generateStepKey() โ {plaintext, hash}` | 6ไฝ step key |
|
|
212
|
-
| `generateTaskKey() โ {plaintext, hash}` | 6ไฝ task key |
|
|
213
|
-
| `generateNodeKey() โ {plaintext, hash}` | 6ไฝ node key |
|
|
214
|
-
| `hashKey(plaintext) โ string` | SHA-256 |
|
|
215
|
-
|
|
216
|
-
### src/core/gate.ts
|
|
217
|
-
| ๅฝๆฐ | ไฝ็จ |
|
|
218
|
-
|------|------|
|
|
219
|
-
| `validateCheckpoint(repo, taskId, stepId, stepKey)` | 5ๆญฅๆ ก้ช๏ผtaskๅญๅจ/active/currentๅน้
/keyๅน้
๏ผ |
|
|
220
|
-
| `advanceSteps(repo, task, completedStepId)` | ่งฃ้ๅ็ปงๆญฅ้ชคๆ็ๆ taskKey |
|
|
221
|
-
| `GateRepository` (interface) | ไปๅบๆฝ่ฑก๏ผgetTask/getCurrentSteps/getTaskSteps/completeAndAdvance/updateTaskStatus/verifyTaskKey |
|
|
222
|
-
|
|
223
|
-
### src/core/session.ts
|
|
224
|
-
| ๅฝๆฐ | ไฝ็จ |
|
|
225
|
-
|------|------|
|
|
226
|
-
| `createSession(workspace) โ SessionInfo` | ๅๅปบ session + ๅๅ
ฅๆไปถ |
|
|
227
|
-
| `verifySessionSecret(sessionId, secret)` | ๆ ก้ช session ๅญๆฎ |
|
|
228
|
-
| `verifyRecoveryToken(sessionId, token)` | ๆ ก้ชๆขๅคๅญๆฎ |
|
|
229
|
-
| `isSessionActive(sessionId)` | ๆฃๆฅ็ถๆ |
|
|
230
|
-
| `getCurrentSessionId()` | ่ฟ็จๅ
ๅ
ฑไบซ sessionId |
|
|
231
|
-
|
|
232
|
-
### src/core/program.ts
|
|
233
|
-
| ๅฝๆฐ | ไฝ็จ |
|
|
234
|
-
|------|------|
|
|
235
|
-
| `createProgram(title, nodes[]) โ ProgramInfo` | ๅๅปบ Program |
|
|
236
|
-
| `getProgramStatus(programId) โ ProgramInfo` | ๆฅ่ฏข็ถๆ |
|
|
237
|
-
| `getReadyNodes(programId) โ ProgramNodeInfo[]` | ๅฏๅผๅง็ node |
|
|
238
|
-
| `startProgramNode(programId, nodeId, sessionId)` | ็ปๅฎ session |
|
|
239
|
-
| `commitProgramNode(sessionId)` | ่ชๅจ็ๆ nodeKey + ๆ ่ฎฐ node ๅฎๆ |
|
|
240
|
-
| `finalizeProgram(programId)` | ๅ
จๅฑๅฎๆดๆงๆฃๆฅ |
|
|
241
|
-
|
|
242
|
-
### src/storage/repository.ts
|
|
243
|
-
| ๅฝๆฐ | ไฝ็จ |
|
|
244
|
-
|------|------|
|
|
245
|
-
| `createTask(task, steps[])` | ๅๅญๅๅ
ฅ task + steps |
|
|
246
|
-
| `getTask(taskId)` | ๆฅ่ฏข task |
|
|
247
|
-
| `getCurrentSteps(taskId)` | ๆฅ่ฏขๆดป่ทๆญฅ้ชค |
|
|
248
|
-
| `getTaskSteps(taskId)` | ๆฅ่ฏขๆๆๆญฅ้ชค |
|
|
249
|
-
| `getActiveTasks(sessionId?)` | ๆดป่ท task๏ผๅฏ้ session ่ฟๆปค๏ผ |
|
|
250
|
-
| `completeAndAdvance(...)` | ๅๅญๅฎๆ+ๆจ่ฟ๏ผไบๅกไฟๆค๏ผ |
|
|
251
|
-
| `verifyStepKey(taskId, stepId, key)` | ไธฅๆ ผๆ ก้ช๏ผstatus='current'๏ผ |
|
|
252
|
-
| `verifyTaskKey(taskId, key)` | ๆ ก้ช taskKey |
|
|
253
|
-
| `verifySkipKey(oldTaskId, stepId, oldKey)` | ้ช่ฏ skip ๅญ่ฏ + ๆฃๆฅๆถ่ดนไบไปถ |
|
|
254
|
-
| `recordSkipConsumed(taskId, stepId)` | ๅๅ
ฅ skip_key_consumed ไบไปถ |
|
|
255
|
-
| `cancelTask(taskId, sessionId)` | ๅๆถ๏ผsession ้จๆง๏ผ |
|
|
256
|
-
| `updateTaskStatus(taskId, status)` | ๆดๆฐ็ถๆ |
|
|
257
|
-
| `addEvent(taskId, stepId, type, payload?)` | ไบไปถ่ฎฐๅฝ |
|
|
258
|
-
| `getEvents(taskId)` | ๆฅ่ฏขไบไปถ |
|
|
259
|
-
|
|
260
|
-
---
|
|
261
|
-
|
|
262
|
-
## 7. Hook ็ณป็ป
|
|
263
|
-
|
|
264
|
-
### SessionStart (`scripts/session-start-hook.sh`)
|
|
265
|
-
```
|
|
266
|
-
่งฆๅ: ๆฏๆฌก็ป็ซฏๅฏๅจ
|
|
267
|
-
็ญ็ฅ: ่ฝป้ไผๅ
โ ่ฏป data/state.json (1ms)๏ผๆ ็ปๆๆ่ฐ CLI
|
|
268
|
-
่กไธบ:
|
|
269
|
-
1. ่ฏป state.json โ ๆๆดป่ท task โ ่ญฆๅ + ๅๅบ่ฟๅบฆ
|
|
270
|
-
2. state ไธบ็ฉบ โ active-task --all โ ่ทจ session ๆฃๆฅ
|
|
271
|
-
3. ๆ ๆชๅฎๆ โ ๆ้ๅฏ็จๅฝไปค
|
|
272
|
-
```
|
|
273
|
-
|
|
274
|
-
### Stop (`.claude/settings.local.json`)
|
|
275
|
-
```
|
|
276
|
-
่งฆๅ: Session ็ปๆๅ
|
|
277
|
-
่กไธบ:
|
|
278
|
-
่ฐ็จ finalize(taskKey) โ ็ณป็ป่ชๅจไผ ๆญๅฐ node/program
|
|
279
|
-
ๅฆๆ taskKey โ ๆฆๆชๆ้
|
|
280
|
-
```
|
|
281
|
-
|
|
282
|
-
### State File (`data/state.json`)
|
|
283
|
-
```
|
|
284
|
-
ๅๅ
ฅๆถๆบ: start-plan / checkpoint / finalize / cancel-task ๅ
|
|
285
|
-
ๅ
ๅฎน: { hasActiveTask, activeTasks: [{taskId, title, completed, total, current}] }
|
|
286
|
-
็จ้: SessionStart 1ms ๅฟซ็
ง๏ผ่ทจไบๅจๆ้
|
|
287
|
-
```
|
|
288
|
-
|
|
289
|
-
---
|
|
290
|
-
|
|
291
|
-
## 8. ๆไปถๅธๅฑ
|
|
292
|
-
|
|
293
|
-
```
|
|
294
|
-
project/
|
|
295
|
-
src/
|
|
296
|
-
cli.ts โ CLI ๅ
ฅๅฃ (504่ก, 12ๅฝไปค)
|
|
297
|
-
index.ts โ MCP Server ๅ
ฅๅฃ (ๅค็จ)
|
|
298
|
-
core/
|
|
299
|
-
plan.ts โ DAG ๅฑๅผ
|
|
300
|
-
keys.ts โ ไธๅฑๅฏ้ฅ็ๆ
|
|
301
|
-
gate.ts โ ๆ ก้ช + ่งฃ้็ถๆๆบ
|
|
302
|
-
session.ts โ Session ็ฎก็
|
|
303
|
-
program.ts โ Program ๅฑ
|
|
304
|
-
errors.ts โ GateError
|
|
305
|
-
storage/
|
|
306
|
-
db.ts โ SQLite (WAL, busy_timeout=5000)
|
|
307
|
-
repository.ts โ ๆฐๆฎๅฑ (20+ ๅฝๆฐ)
|
|
308
|
-
tools/ โ MCP ๅทฅๅ
ท (ๅค็จ)
|
|
309
|
-
startPlan.ts / checkpoint.ts / current.ts
|
|
310
|
-
finalize.ts / cancelTask.ts / activeTask.ts / index.ts
|
|
311
|
-
types/
|
|
312
|
-
index.ts โ ๅ
จ้จ็ฑปๅๅฎไน
|
|
313
|
-
tests/
|
|
314
|
-
core.test.ts โ 36 tests
|
|
315
|
-
storage.test.ts โ 34 tests
|
|
316
|
-
tools.test.ts โ 29 tests (ๅซ A1/B1)
|
|
317
|
-
ci-blackbox.test.ts โ 15 tests (MCP ๅ่ฎฎ็บง)
|
|
318
|
-
e2e-smoking-app.test.ts โ E2E ๅผบๅถๅ้
|
|
319
|
-
e2e-multi-agent.test.ts โ E2E ๅคAgentๅไฝ
|
|
320
|
-
scripts/
|
|
321
|
-
session-start-hook.sh
|
|
322
|
-
prompt-check-hook.sh
|
|
323
|
-
mcp-backup/ โ MCP ๅฎๆดๅคไปฝ
|
|
324
|
-
data/
|
|
325
|
-
gate.db โ SQLite ๆฐๆฎๅบ
|
|
326
|
-
state.json โ ่ฝป้ๅฟซ็
ง
|
|
327
|
-
.step-gate/
|
|
328
|
-
sessions/ โ Session ๅญๆฎๆไปถ
|
|
329
|
-
bindings/ โ CLI ็ปๅฎๆไปถ
|
|
330
|
-
openspec/changes/ โ ๅๆดๆๆกฃ
|
|
331
|
-
SKILL.md โ Skill ๅฎไน
|
|
332
|
-
ARCHITECTURE.md โ ๆฌๆๆกฃ
|
|
333
|
-
```
|
|
334
|
-
|
|
335
|
-
---
|
|
336
|
-
|
|
337
|
-
## 9. ้่ฏฏ็
|
|
338
|
-
|
|
339
|
-
| ้่ฏฏ็ | ๅซไน |
|
|
340
|
-
|--------|------|
|
|
341
|
-
| TASK_NOT_FOUND | taskId ไธๅญๅจ |
|
|
342
|
-
| TASK_ALREADY_COMPLETED | ไปปๅกๅทฒๅฎๆ |
|
|
343
|
-
| NO_STEPS | ่ฎกๅๆ ๆญฅ้ชค |
|
|
344
|
-
| INVALID_CURRENT_STEP | ๆญฅ้ชคไธๅจๅฝๅ็ถๆ |
|
|
345
|
-
| INVALID_STEP_KEY | stepKey ๆ ก้ชๅคฑ่ดฅ |
|
|
346
|
-
| INVALID_FINAL_KEY | taskKey ๆ ก้ชๅคฑ่ดฅ |
|
|
347
|
-
| INVALID_RECOVERY_TOKEN | recoveryToken ๆ ก้ชๅคฑ่ดฅ |
|
|
348
|
-
| PLAN_SCHEMA_INVALID | ่ฎกๅๆ ผๅผ้่ฏฏ |
|
|
349
|
-
| SKIP_VERIFY_FAILED | skip ๅญ่ฏ้ช่ฏๅคฑ่ดฅๆๅทฒๆถ่ดน |
|
|
350
|
-
| NO_SESSION | ๆ session ็ปๅฎ |
|
|
351
|
-
| INTERNAL_ERROR | ๆฐๆฎๅบ/ๅ
้จ้่ฏฏ |
|
|
352
|
-
|
|
353
|
-
---
|
|
354
|
-
|
|
355
|
-
## 10. ๅ
ธๅๆต็จ
|
|
356
|
-
|
|
357
|
-
### ๅ Session
|
|
358
|
-
```bash
|
|
359
|
-
start-plan โ checkpoint ร N โ finalize taskKey
|
|
360
|
-
# โ ่ชๅบๅไธ: task โ node โ program (ๅฆๆ)
|
|
361
|
-
```
|
|
362
|
-
|
|
363
|
-
### ไธญๆญๆขๅค
|
|
364
|
-
```bash
|
|
365
|
-
start-plan โ checkpoint auth โ
|
|
366
|
-
โ current (ๆฅ็ถๆ) โ cancel-task
|
|
367
|
-
โ start-plan (skipKey+skipTaskId ้ๅปบ๏ผๆง key ่ขซๆถ่ดน)
|
|
368
|
-
โ checkpoint โ finalize taskKey
|
|
369
|
-
```
|
|
370
|
-
|
|
371
|
-
### ่ทจ Session Program
|
|
372
|
-
```bash
|
|
373
|
-
program init โ program start pg-1
|
|
374
|
-
โ start-plan โ checkpoint ร N โ finalize taskKey
|
|
375
|
-
# โ ่ชๅจๆ ่ฎฐ pg-1 completed + nodeKey ็ๆ
|
|
376
|
-
|
|
377
|
-
program start pg-2
|
|
378
|
-
โ start-plan โ checkpoint ร N โ finalize taskKey
|
|
379
|
-
# โ ่ชๅจๆ ่ฎฐ pg-2 completed๏ผprogram completed
|
|
380
|
-
```
|
|
381
|
-
|
|
382
|
-
---
|
|
383
|
-
|
|
384
|
-
## 11. ๆๆฏๆ
|
|
385
|
-
|
|
386
|
-
- **Runtime**: Node.js 20+
|
|
387
|
-
- **Language**: TypeScript ESM
|
|
388
|
-
- **Storage**: better-sqlite3 (WAL, synchronous=NORMAL, busy_timeout=5000)
|
|
389
|
-
- **Validation**: Zod v4 (MCP tools)
|
|
390
|
-
- **Test**: vitest (116 tests, 6 suites)
|
|
391
|
-
- **Key**: crypto.randomBytes โ [A-Z0-9]{6} โ SHA-256
|
|
392
|
-
- **IDs**: 6ไฝ [A-Z0-9] (36^6 โ 21ไบฟ็ต)
|
|
393
|
-
- **MCP SDK**: @modelcontextprotocol/sdk v1.x (ๅค็จ)
|