@cloverleaf/reference-impl 0.7.2 → 0.7.3
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloverleaf/reference-impl",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3",
|
|
4
4
|
"description": "Reference implementation of the Cloverleaf methodology as Claude Code skills. Implements the Tight Loop (Implementer + Reviewer).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -111,11 +111,23 @@ description: Autonomous DAG walker for Cloverleaf Plans. Given a PLAN-ID in stat
|
|
|
111
111
|
|
|
112
112
|
Record the returned `session_id`, `worktree_path`, and `branch_name` in walk-state with `state: "running"`, `started_at: <now>`, `last_seq: 0`. Persist via `walk-state-write`.
|
|
113
113
|
|
|
114
|
-
Immediately after `mcp__claw-drive__start_session` returns,
|
|
114
|
+
Immediately after `mcp__claw-drive__start_session` returns, read the `notification_contract` from the session response and validate it:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
IDLE_AFTER=$(echo "$START_SESSION_RESPONSE" | jq -r '.notification_contract.idle_after_seconds // 600')
|
|
118
|
+
EXPECTED_TOKENS="DONE NEEDS-INPUT"
|
|
119
|
+
for tok in $EXPECTED_TOKENS; do
|
|
120
|
+
if ! echo "$START_SESSION_RESPONSE" | jq -e ".notification_contract.vocabulary | index(\"$tok\")" > /dev/null 2>&1; then
|
|
121
|
+
echo "WARNING: notification_contract.vocabulary missing expected token '$tok' — vocab drift detected" >&2
|
|
122
|
+
fi
|
|
123
|
+
done
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Then attach a Monitor tool stream for the new session:
|
|
115
127
|
|
|
116
128
|
```
|
|
117
129
|
Monitor(
|
|
118
|
-
watch_command: "claw-drive watch <session_id> --since 0 --idle-after
|
|
130
|
+
watch_command: "claw-drive watch <session_id> --since 0 --idle-after $IDLE_AFTER",
|
|
119
131
|
persistent: true,
|
|
120
132
|
timeout_ms: 3600000
|
|
121
133
|
)
|
|
@@ -127,13 +139,13 @@ description: Autonomous DAG walker for Cloverleaf Plans. Given a PLAN-ID in stat
|
|
|
127
139
|
|
|
128
140
|
```
|
|
129
141
|
Monitor(
|
|
130
|
-
watch_command: "claw-drive watch <session_id> --since <last_seq> --idle-after
|
|
142
|
+
watch_command: "claw-drive watch <session_id> --since <last_seq> --idle-after $IDLE_AFTER",
|
|
131
143
|
persistent: true,
|
|
132
144
|
timeout_ms: 3600000
|
|
133
145
|
)
|
|
134
146
|
```
|
|
135
147
|
|
|
136
|
-
The `--idle-after
|
|
148
|
+
The `--idle-after $IDLE_AFTER` flag instructs claw-drive to emit a synthetic `idle` event if a session produces no output for `$IDLE_AFTER` seconds, enabling the walker to detect stalled sessions without polling.
|
|
137
149
|
|
|
138
150
|
d. **Handle events.** Dispatch each incoming Monitor event by type:
|
|
139
151
|
|
|
@@ -342,3 +354,7 @@ The concrete policy JSON is the same one used during the CLV-16..CLV-20 dogfood
|
|
|
342
354
|
- Final-gate drain is serial across tasks — one prompt, one decision.
|
|
343
355
|
- The walker exits after the loop reports the final status; it does not auto-retry escalated tasks.
|
|
344
356
|
- Scope-contested merges are escalated, never auto-resolved.
|
|
357
|
+
|
|
358
|
+
## Notes
|
|
359
|
+
|
|
360
|
+
**Vocab dependency.** The walker reads `notification_contract.vocabulary` from the `start_session` response advisorily — if the expected tokens (`DONE`, `NEEDS-INPUT`) are absent it warns to stderr but continues. The authoritative source of truth for which tokens Session B will emit is the SDK's `--driven-tokens` flag passed when claw-drive spawns the session. A mismatch between the contract and the actual flag signals a version skew between the claw-drive server and the reference-impl skill; upgrade both components together to keep them in sync.
|