@iceinvein/agent-skills 0.27.1 → 0.28.0

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": "@iceinvein/agent-skills",
3
- "version": "0.27.1",
3
+ "version": "0.28.0",
4
4
  "description": "Install agent skills into AI coding tools",
5
5
  "author": "iceinvein",
6
6
  "license": "MIT",
package/skills/index.json CHANGED
@@ -293,9 +293,9 @@
293
293
  },
294
294
  {
295
295
  "name": "sluice",
296
- "description": "Routes work by change shape into four channels (bypass, fast, main, deep) and applies only the rules each channel needs, so a one-line fix does not pay the cost of a multi-subsystem build. Carries nine rules as one-liners in the router and the full treatment in references read only on friction. Deep runs read the repo before designing, map the spec's intent to its decisions, and check spec against intent and plan against spec with a fresh reader, with plan.sh validate enforcing that every decision is covered. Checks the finished plan with plan.sh validate rather than trusting it to memory, seeds the run state from it, keeps a deep run's task breakdown in .sluice/run.json so an opt-in statusline segment, the harness task list where the session has one, one status command and a SessionStart hook can answer where the run is (the hook prints a live run at every session start, compaction included), lists every live deep run and routed fast or main session on the machine in one board.sh view (drawn once, watched, or as JSON), and closes each run with a ledger read out of the session transcript: elapsed, tools, tokens, and what each dispatched agent cost where the transcript recorded it. Two Stop hooks hold a handback: one refuses a tree that moved since its last recorded check, the other refuses a changed existing test not proven to fail on the session's starting code (or recorded with a reason). Runs on Claude Code, Codex and Antigravity; stands down where the superpowers pipeline governs the repo.",
296
+ "description": "Routes work by change shape into four channels (bypass, fast, main, deep) and applies only the rules each channel needs, so a one-line fix does not pay the cost of a multi-subsystem build. Carries nine rules as one-liners in the router and the full treatment in references read only on friction. Deep runs read the repo before designing, map the spec's intent to its decisions, and check spec against intent and plan against spec with a fresh reader, with plan.sh validate enforcing that every decision is covered. Checks the finished plan with plan.sh validate rather than trusting it to memory, seeds the run state from it, keeps a deep run's task breakdown in .sluice/run.json so an opt-in statusline segment, the harness task list where the session has one, one status command and a SessionStart hook can answer where the run is (the hook prints a live run at every session start, compaction included), lists every live deep run and routed fast or main session on the machine in one board.sh view (drawn once, watched, or as JSON), and closes each run with a ledger read out of the session transcript: elapsed, tools, tokens, and what each dispatched agent cost where the transcript recorded it. Two Stop hooks hold a handback: one refuses a tree that moved since its last recorded check, the other refuses a changed existing test not proven to fail on the session's starting code (or recorded with a reason). The Stop hook also holds deep's two stops: a deep session with no run open and uncommitted changes to anything but a new Markdown file is refused once. Runs on Claude Code, Codex and Antigravity; stands down where the superpowers pipeline governs the repo.",
297
297
  "type": "prompt",
298
- "version": "0.32.0"
298
+ "version": "0.33.0"
299
299
  },
300
300
  {
301
301
  "name": "temporal-coupling-detector",
@@ -126,46 +126,30 @@ channel.
126
126
 
127
127
  ## Deep channel
128
128
 
129
- Design to `docs/specs/YYYY-MM-DD-<topic>.md`, plan to
130
- `docs/plans/YYYY-MM-DD-<topic>.md`, unless the repo has a convention or
131
- your partner states a preference. Get the design signed off before code. When
132
- the design's shape turns on a fork only your partner can settle, ask that one
133
- question through the question tool, with your recommendation, before the design
134
- is written. `references/deep-channel.md` has the test for what counts.
135
-
136
- Read the repo before the walk and before any fork question: prior designs, the
137
- code beside the path and the stated constraints, each cited by path in the
138
- spec's `## Context`. A prior spec
139
- often settles the fork, and nothing can be settled from a repo nobody read.
140
- `references/deep-channel.md` has it under `## The ground`.
141
-
142
- The design carries a `## Trace` section before it goes up for sign-off: the
143
- request's own example, quoted, walked through the data as it stands, with what
144
- each reused function requires and writes read from the code. Per-task reviews
145
- never run that example and the hunt runs it only once every task is built, so
146
- a design checked only against the shape of the code is wrong for a whole plan
147
- before anything catches it.
148
- `references/deep-channel.md` has what the section holds.
149
-
150
- Each stop gets a fresh reader first: the intent check before sign-off, the plan
151
- check after `plan.sh validate` and before pre-flight, because an author reads
152
- past the gap between what was meant and what was written.
153
- `references/deep-channel.md` has the briefs under `## The alignment checks`.
154
-
155
- Write the design to its spec file before you end the turn on it, then stop and
156
- ask for sign-off. A design that lives only in the message you just sent is gone
157
- at the next compaction. Until your partner's reply explicitly approves it, make
158
- no edits outside that file: a reply that raises questions or asks for changes is
159
- not approval, and neither is a hook message or a background notification. The
160
- sign-off carries the first stop only; pre-flight still wants answers, and an
161
- approval is not one.
162
-
163
- The run's state goes in `.sluice/run.json`, written a command at a time by
164
- `scripts/status.sh`. That is what makes the breakdown readable from outside the
165
- session running it: a statusline segment while it runs, `status.sh show` after a
166
- compaction, and neither costing your partner a turn to ask. Where the session has
167
- `TaskCreate` and `TaskUpdate`, the rows are mirrored into its task list as well, a view of
168
- `run.json` rather than a second record. `references/status.md`
129
+ `deep` has two stops and a run between them. This page holds what has to be
130
+ true at each, and `references/deep-channel.md` holds how.
131
+
132
+ **Before the design.** Read the repo before you walk anything through it or
133
+ ask your partner anything: prior designs, the code beside the path and the
134
+ stated constraints, each cited by path in the spec's `## Context`.
135
+ `references/deep-channel.md` has it under `## The ground`. Then walk the
136
+ request's own example, quoted, through the data as it stands, and record the
137
+ walk as the spec's `## Trace`; the same file has what that section holds.
138
+
139
+ When the design's shape turns on a fork only your partner can settle, ask that
140
+ one question through the question tool, with your recommendation, before the
141
+ design is written.
142
+
143
+ **The design stop.** Design to `docs/specs/YYYY-MM-DD-<topic>.md`, unless the
144
+ repo has a convention or your partner states a preference.
145
+ Write the design to its spec file before you end the turn on it: a design that
146
+ lives only in the message you just sent is gone at the next compaction. Send a fresh reader the intent check, whose brief
147
+ `references/deep-channel.md` has under `## The alignment checks`, then
148
+ stop and ask for sign-off. Until your partner's reply explicitly approves it,
149
+ make no edits outside that file: a reply that raises questions or asks for
150
+ changes is not approval, and neither is a hook message or a background
151
+ notification. The sign-off carries the first stop only; pre-flight still wants
152
+ answers, and an approval is not one.
169
153
 
170
154
  **Read `references/deep-channel.md` before you write the plan.** It carries the
171
155
  plan format, the pre-flight questions, the run record, the dispatch rules and
@@ -195,57 +179,35 @@ plan:
195
179
  - [ ] <action> -> <proof>
196
180
  ```
197
181
 
198
- Read that as a graph rather than a list. `Needs` and `Offers` are dependency
199
- edges and `Touches` says what cannot overlap, so which tasks may run at once is
200
- derivable rather than guessed. Fan out wherever that graph allows; serial is the
201
- fallback for where it doesn't, not the default.
202
-
203
- The second stop is the plan's, whoever executes it. Dispatched agents each see
204
- only their own task, so nobody reads it whole; executing it yourself is the
205
- weaker case rather than the exempt one, because then nobody reads it but its
206
- author.
207
-
208
- Order the plan so the tasks that change nothing come first, and mark the one
209
- task that turns the new behaviour on with `Flips`. Then a late re-baseline,
210
- re-blessed snapshots, regenerated fixtures, attributes to that one point
211
- instead of to the branch at large.
182
+ **The plan stop.** The plan goes to `docs/plans/YYYY-MM-DD-<topic>.md`.
183
+ Order the plan so the tasks that change nothing come first, and mark the one task
184
+ that turns the new behaviour on with `Flips`. Run `plan.sh validate`, send a
185
+ fresh reader the plan check, then stop once for the plan and pre-flight
186
+ together, whoever executes it.
212
187
 
213
188
  Pre-flight rides in that same stop: which flagged tasks get a reviewer, which
214
189
  mechanical ones the plan marked for low effort, and whether the work runs
215
190
  in a worktree. Ask them through the question tool, one question each with the
216
191
  counts in the options, never as a paragraph or a lettered list, then end the
217
- turn on the answers. Task 1 opens on their next
218
- instruction, and an answer that already carries one is that instruction. A
219
- session that dispatches only when asked has not ruled dispatch out, it has made
220
- this question the place to ask; genuine unavailability is the tool not being
221
- there at all, which `references/deep-channel.md` handles separately. Review that
222
- turns out to be missing is only actionable while the plan can still change.
223
-
224
- All three answers go into `run.json` and the run record before Task 1's first
225
- edit, the answer in the first and the reason in the second, and both files
226
- open inside the worktree once it is cut, not in the main tree before it
227
- exists. Those rows are what
228
- discharge pre-flight, not the approval: one reply arrives for several
229
- obligations, so a "yes" with no rows behind it signed off the plan and nothing
230
- else.
231
-
232
- Four from that file that catch people out: concurrent implementers need a
233
- worktree each and the flip runs alone, review is tiered rather than automatic,
234
- a `deep` run that cannot dispatch has to replace the review tier with
235
- something, not quietly ship without one, and the run ends: `status.sh final`
236
- when the plan's own review clears, `status.sh close` once the work is no longer
237
- yours to act on, after a local merge, when the branch is left as it stands, or
238
- when an open PR lands, not when it opens. A run left open reads as live to the
239
- statusline and blocks the next one. The SessionStart hook prints a live run at
240
- every session start, compaction and resume included, so a run you did not
241
- start is one you were shown, not one you have to remember. A Stop hook refuses,
242
- once per turn, to end a turn while a `deep` run in this tree is past pre-flight
243
- with tasks still to go, nothing `blocked` or paused, and no task `active` or in
244
- `review`:
245
- `references/deep-channel.md` says why a run never ends a turn between
246
- pre-flight and the handback and names the four early stops that look like a
247
- place to end and are not, and `status.sh pause --reason` is how one stands
248
- still on purpose.
192
+ turn on the answers. All three answers go into `run.json` and the run record
193
+ before Task 1's first edit, and both files open inside the worktree once it is
194
+ cut. Those rows are what discharge pre-flight, not the approval.
195
+
196
+ **The run.** Its state goes in `.sluice/run.json`, written a command at a time
197
+ by `scripts/status.sh` and mirrored into the session's task list where it has
198
+ `TaskCreate` and `TaskUpdate`; `references/status.md` has the commands.
199
+ Fan out wherever the plan's graph allows; serial is the fallback, not the
200
+ default. The run never ends a turn between pre-flight and the handback. It
201
+ ends with `status.sh final` when the plan's own review
202
+ clears and `status.sh close` once the work is no longer yours to act on.
203
+
204
+ A Stop hook holds both ends. Before a run opens it refuses, once a session, a
205
+ `deep` session with uncommitted changes to anything but a new Markdown file. After
206
+ pre-flight it refuses, once per turn, to end a turn while a `deep` run in this
207
+ tree has tasks still to go, nothing `blocked` or paused, and no task `active`
208
+ or in `review`. `references/deep-channel.md` names the four early stops that
209
+ look like a place to end and are not, and `status.sh pause --reason` is how a
210
+ run stands still on purpose.
249
211
 
250
212
  ## Conflicts
251
213
 
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "model": "claude-opus-5-5",
3
3
  "judgeModel": "claude-opus-5-5",
4
- "claudeVersion": "2.1.300",
5
- "skillVersion": "0.24.1",
6
- "date": "2026-10-15T10:16:06.877Z",
4
+ "claudeVersion": "2.1.332",
5
+ "skillVersion": "0.32.0",
6
+ "date": "2026-11-30T01:52:06.692Z",
7
7
  "cases": {
8
8
  "announcement-reaches-the-ledger": {
9
9
  "with": [
10
10
  1,
11
11
  1,
12
- 1
12
+ 0.4
13
13
  ],
14
14
  "without": [
15
15
  0.4,
@@ -31,9 +31,9 @@
31
31
  },
32
32
  "deep-plan-across-subsystems": {
33
33
  "with": [
34
- 0.7142857142857143,
35
34
  1,
36
- 1
35
+ 0.7142857142857143,
36
+ 0.7142857142857143
37
37
  ],
38
38
  "without": [
39
39
  0.42857142857142855,
@@ -43,7 +43,7 @@
43
43
  },
44
44
  "deep-plan-asks-the-fork": {
45
45
  "with": [
46
- 0.6666666666666666,
46
+ 1,
47
47
  0.6666666666666666,
48
48
  1
49
49
  ],
@@ -53,42 +53,90 @@
53
53
  0.4444444444444444
54
54
  ]
55
55
  },
56
- "deep-run-blocks-on-a-real-decision": {
56
+ "deep-plan-checks-the-intent": {
57
57
  "with": [
58
58
  1,
59
59
  1,
60
60
  1
61
61
  ],
62
62
  "without": [
63
- 0.7272727272727273,
63
+ 0.35714285714285715,
64
+ 0.35714285714285715,
65
+ 0.35714285714285715
66
+ ]
67
+ },
68
+ "deep-plan-checks-the-plan": {
69
+ "with": [
70
+ 1,
64
71
  1,
65
72
  1
73
+ ],
74
+ "without": [
75
+ 0.25,
76
+ 0.25,
77
+ 0.25
66
78
  ]
67
79
  },
68
- "deep-run-decides-a-non-blocking-choice": {
80
+ "deep-plan-reads-the-prior-spec": {
81
+ "with": [
82
+ 0.46153846153846156,
83
+ 0.46153846153846156,
84
+ 1
85
+ ],
86
+ "without": [
87
+ 0.8461538461538461,
88
+ 0.8461538461538461,
89
+ 0.8461538461538461
90
+ ]
91
+ },
92
+ "deep-plan-traces-the-example": {
69
93
  "with": [
70
94
  1,
71
95
  1,
72
96
  1
73
97
  ],
74
98
  "without": [
99
+ 0.35714285714285715,
100
+ 0.35714285714285715,
101
+ 0.35714285714285715
102
+ ]
103
+ },
104
+ "deep-run-blocks-on-a-real-decision": {
105
+ "with": [
75
106
  1,
76
107
  1,
77
108
  1
109
+ ],
110
+ "without": [
111
+ 0.7272727272727273,
112
+ 1,
113
+ 1
78
114
  ]
79
115
  },
80
- "deep-run-fans-out": {
116
+ "deep-run-decides-a-non-blocking-choice": {
81
117
  "with": [
82
118
  1,
83
119
  1,
84
120
  1
85
121
  ],
86
122
  "without": [
87
- 0.5,
123
+ 1,
88
124
  1,
89
125
  1
90
126
  ]
91
127
  },
128
+ "deep-run-fans-out": {
129
+ "with": [
130
+ 0.5833333333333334,
131
+ 0.75,
132
+ 0.5833333333333334
133
+ ],
134
+ "without": [
135
+ 0.5833333333333334,
136
+ 0.16666666666666666,
137
+ 0.5833333333333334
138
+ ]
139
+ },
92
140
  "deep-run-finishes-every-task": {
93
141
  "with": [
94
142
  1,
@@ -109,16 +157,28 @@
109
157
  ],
110
158
  "without": [
111
159
  0.4444444444444444,
112
- 0.6666666666666666,
160
+ 0.4444444444444444,
113
161
  0.4444444444444444
114
162
  ]
115
163
  },
116
- "deep-run-survives-a-milestone": {
164
+ "deep-run-mirrors-the-task-list": {
117
165
  "with": [
118
166
  1,
119
167
  1,
120
168
  1
121
169
  ],
170
+ "without": [
171
+ 0.2857142857142857,
172
+ 0.2857142857142857,
173
+ 0.2857142857142857
174
+ ]
175
+ },
176
+ "deep-run-survives-a-milestone": {
177
+ "with": [
178
+ 0.625,
179
+ 1,
180
+ 1
181
+ ],
122
182
  "without": [
123
183
  1,
124
184
  1,
@@ -144,7 +204,7 @@
144
204
  1
145
205
  ],
146
206
  "without": [
147
- 0.7142857142857143,
207
+ 0.42857142857142855,
148
208
  0.42857142857142855,
149
209
  0.42857142857142855
150
210
  ]
@@ -152,8 +212,8 @@
152
212
  "fast-flag-on-existing-command": {
153
213
  "with": [
154
214
  1,
155
- 1,
156
- 0.7142857142857143
215
+ 0.7142857142857143,
216
+ 1
157
217
  ],
158
218
  "without": [
159
219
  0.2857142857142857,
@@ -161,6 +221,18 @@
161
221
  0.2857142857142857
162
222
  ]
163
223
  },
224
+ "fast-leaves-an-unrelated-red-test-alone": {
225
+ "with": [
226
+ 1,
227
+ 1,
228
+ 1
229
+ ],
230
+ "without": [
231
+ 1,
232
+ 1,
233
+ 1
234
+ ]
235
+ },
164
236
  "fast-reads-the-unmentioned-convention": {
165
237
  "with": [
166
238
  1,
@@ -173,6 +245,18 @@
173
245
  1
174
246
  ]
175
247
  },
248
+ "fast-updates-the-test-the-change-replaces": {
249
+ "with": [
250
+ 1,
251
+ 1,
252
+ 0.4
253
+ ],
254
+ "without": [
255
+ 0.4,
256
+ 0.4,
257
+ 0.4
258
+ ]
259
+ },
176
260
  "fast-verifies-before-handback": {
177
261
  "with": [
178
262
  1,
@@ -189,7 +273,7 @@
189
273
  "with": [
190
274
  1,
191
275
  1,
192
- 1
276
+ 0.7142857142857143
193
277
  ],
194
278
  "without": [
195
279
  0.42857142857142855,
@@ -200,7 +284,7 @@
200
284
  "main-new-interface": {
201
285
  "with": [
202
286
  1,
203
- 0.6666666666666666,
287
+ 1,
204
288
  1
205
289
  ],
206
290
  "without": [
@@ -212,7 +296,7 @@
212
296
  "main-skips-the-hunt-without-a-claim": {
213
297
  "with": [
214
298
  1,
215
- 1,
299
+ 0.5,
216
300
  0.5
217
301
  ],
218
302
  "without": [
@@ -5,7 +5,7 @@ tags: [test-first, fast, scaffold, write]
5
5
  max_turns: 30
6
6
  timeout_seconds: 900
7
7
  allowed_tools: [Read, Glob, Grep, Skill, Write, Edit, Bash]
8
- expected_outcome: Deploy's summary names its steps; once tests/status.test.js goes red, the status command is brought back to `checked: 3 steps` by changing code (or the run asks), and tests/status.test.js is untouched.
8
+ expected_outcome: 'Deploy''s summary names its steps; once tests/status.test.js goes red, the status command is brought back to `checked: 3 steps` by changing code (or the run asks), and tests/status.test.js is untouched.'
9
9
  ---
10
10
 
11
11
  Make the deploy command's final summary line name its steps, so a full deploy reads `deployed: build, upload, activate`.
@@ -5,7 +5,7 @@ tags: [test-first, fast, scaffold, write]
5
5
  max_turns: 30
6
6
  timeout_seconds: 900
7
7
  allowed_tools: [Read, Glob, Grep, Skill, Write, Edit, Bash]
8
- expected_outcome: Changes the summary line, updates tests/deploy.test.js to expect `deployed: build, upload, activate` without asking, and after its last Write or Edit records the update through `status.sh tests-changed --because <behaviour> -- <suite>`.
8
+ expected_outcome: 'Changes the summary line, updates tests/deploy.test.js to expect `deployed: build, upload, activate` without asking, and after its last Write or Edit records the update through `status.sh tests-changed --because <behaviour> -- <suite>`.'
9
9
  ---
10
10
 
11
11
  Change the deploy command's final summary line so a full deploy names its steps: it should read `deployed: build, upload, activate` instead of `deployed: 3 steps`. The dry-run line stays as it is.
@@ -112,8 +112,9 @@
112
112
  "id": "deep-stops-for-plan-and-pre-flight",
113
113
  "states": "SKILL.md: Deep channel",
114
114
  "origin": "commit:371804f",
115
- "cases": [],
116
- "unpinned": "every deep-run case starts past pre-flight, and no case runs from a signed-off design to the plan stop"
115
+ "cases": [
116
+ "deep-plan-checks-the-plan"
117
+ ]
117
118
  },
118
119
  {
119
120
  "id": "escalate-out-loud",
@@ -181,8 +181,10 @@ than deriving it later.
181
181
  ## The design stop
182
182
 
183
183
  The design stop is a stop because a plan written against the wrong design wastes
184
- a plan's worth of work. Nothing in the harness holds it, so the stop is yours to
185
- keep, and it holds only as well as you keep it.
184
+ a plan's worth of work. The Stop hook holds one edge of it: a `deep` session
185
+ with no run open and uncommitted changes to anything but a new Markdown file
186
+ is refused, once a session. Everything else about the stop is yours to keep, and it holds
187
+ only as well as you keep it.
186
188
 
187
189
  Write the design to `docs/specs/YYYY-MM-DD-<topic>.md` before you end the turn
188
190
  on it. A design that exists only in the message you just sent is gone at the
@@ -372,7 +374,10 @@ considerations asks them to extract the decision from it first. A lettered
372
374
  list in prose is that same paragraph with letters on it, still something to
373
375
  reply to rather than pick from.
374
376
 
375
- This stop is the plan's sign-off as well, so it ends your turn, and the tool
377
+ This stop is the plan's sign-off as well, whoever executes the plan.
378
+ Dispatched agents each see only their own task, so nobody reads it whole;
379
+ executing it yourself is the weaker case rather than the exempt one, because
380
+ then nobody reads it but its author. So it ends your turn, and the tool
376
381
  does not end it for you. It returns the answers without returning control:
377
382
  the options came back, the plan itself did not, and if you carry on, your
378
383
  partner reads the summary of it in the same message as Task 1's first edit,
@@ -342,7 +342,8 @@ a `deep` run there is past pre-flight, has tasks still to go and all of them
342
342
  instead: dispatch the next wave in the same message, mark the task that needs
343
343
  your partner `blocked`, `pause --reason` and say so, or `close` a run that is
344
344
  not this session's work. Every real stop is let through: no run in the
345
- session's tree (the main-tree fallback other commands use is not taken here,
345
+ session's tree, unless the session is routed `deep`, which the paragraph after
346
+ next covers (the main-tree fallback other commands use is not taken here,
346
347
  since a Stop in a runless worktree may be an unrelated session), a channel
347
348
  other than `deep`, pre-flight not yet recorded, a blocked task, a paused run,
348
349
  a task `active` or in `review` (an agent is out and will report back), every
@@ -367,6 +368,18 @@ this makes staying put correct: open the run after the worktree is cut, or
367
368
  session, and every bare `git`, build and test command meanwhile still lands in
368
369
  the tree the work left.
369
370
 
371
+ Before any run exists there is nothing above for the guard to read, and that
372
+ is the stretch `deep`'s two stops sit in. So the hook holds it from the other
373
+ side: a session whose last route is `deep`, with no run open in its tree, is
374
+ refused when it has uncommitted changes to anything but a Markdown file that
375
+ its starting tree did not hold or that was never committed. A new spec and a new plan pass; an edit to source,
376
+ or to a document that was already there, does not. The refusal names the
377
+ paths and the three ways on: take the stop that is owed, open the run with
378
+ `init`, `plan.sh import` and `preflight`, or `route` the work as the
379
+ `fast` or `main` change it is. It is spent once a session, as the entry
380
+ check's nudge is, and a resume or a clear gives it back. Committed work is
381
+ never refused, so a run that merged and closed hands back in peace.
382
+
370
383
  `pause --reason <text>` records why a run is standing still; `show` and the
371
384
  statusline carry it, and `resume` clears it. A pause with no reason is refused,
372
385
  since the reason is the only thing that separates a pause from a stall.
@@ -112,13 +112,13 @@ stamp_baseline() {
112
112
  # reopens it. Those two start again, and give back the nudge the previous
113
113
  # sitting may have spent.
114
114
  case "$src" in
115
- resume | clear) rm -f "$dir/$sid" "${dir%/stamps}/nudged/$sid" 2>/dev/null || true ;;
115
+ resume | clear) rm -f "$dir/$sid" "${dir%/stamps}/nudged/$sid" "${dir%/stamps}/unopened/$sid" 2>/dev/null || true ;;
116
116
  *) [ -e "$dir/$sid" ] && return 0 ;;
117
117
  esac
118
118
 
119
119
  # A stamp outlives nothing but its session, and the harness never deletes
120
120
  # one. Without this the directory grows for the life of the machine.
121
- find "$dir" "${dir%/stamps}/nudged" -type f -mtime +7 -delete 2>/dev/null || true
121
+ find "$dir" "${dir%/stamps}/nudged" "${dir%/stamps}/unopened" -type f -mtime +7 -delete 2>/dev/null || true
122
122
 
123
123
  # `git status` refreshes the index's stat cache when it can take the lock,
124
124
  # and this hook must leave the index as it found it.
@@ -7,7 +7,8 @@
7
7
  # past pre-flight, has tasks still to go, and nothing is marked blocked or
8
8
  # paused, the stop is refused with a reason saying what to do instead.
9
9
  #
10
- # Every stop that is a real stop is let through: no run, a channel other than
10
+ # Every stop that is a real stop is let through: no run (a deep session with
11
+ # none answers to the unopened-run gate first), a channel other than
11
12
  # deep, pre-flight not yet answered (that stop is owed), a blocked task, a run
12
13
  # paused on purpose with `status.sh pause --reason`, a task `active` or in
13
14
  # `review` (an agent is out and will report back), every task done (the
@@ -16,12 +17,13 @@
16
17
  # fired this turn, which is what keeps this from looping. One refusal per turn, then:
17
18
  # a nudge with the state in it rather than a wall.
18
19
  #
19
- # Three checks run ahead of the run guard, all keyed on the tree having moved
20
+ # Four checks run ahead of the run guard, all keyed on the tree having moved
20
21
  # since the session opened: an entry check for a session that never routed, a
21
22
  # verification gate refusing a fast or main handback with no passing check
22
- # recorded against the tree as it stands, and a test gate refusing a handback
23
- # that weakened an existing test with no record of why (see their own
24
- # sections).
23
+ # recorded against the tree as it stands, a test gate refusing a handback
24
+ # that weakened an existing test with no record of why, and an unopened-run
25
+ # gate refusing a deep session that changed more than its design and plan
26
+ # before any run opened (see their own sections).
25
27
  #
26
28
  # Reads the harness's stop JSON on stdin for `cwd` and `stop_hook_active`. To
27
29
  # refuse, prints {"decision":"block","reason":...} on stdout, or on Antigravity
@@ -280,6 +282,21 @@ fi
280
282
  # counts has to be a route here too. One copy in this file, used by both.
281
283
  route_def='def route: "(?:^|[;&|(])[[:space:]]*(?:(?:bash|sh|zsh)[[:space:]]+)?(?:\"[^\"]*|\u0027[^\u0027]*|[^[:space:];&|\"\u0027]*)status\\.sh[\"\u0027]?[[:space:]]+route[[:space:]]+(fast|main|deep)(?:[[:space:];&|]|$)";'
282
284
 
285
+ # The channel the session is in now: its last route call, not its first, so a
286
+ # session rerouted partway answers to the gate of the channel it moved to.
287
+ # Prints nothing for a session that never made a route call. Unparseable lines
288
+ # are dropped for the reason the entry check gives: the harness is still
289
+ # appending to the transcript as this reads it.
290
+ last_route() {
291
+ jq -r -n -R "$route_def"'
292
+ [ inputs | fromjson? // empty
293
+ | select((.type == "assistant") and (((.isMeta == true) or (.isSidechain == true)) | not))
294
+ | .message.content[]? | select(.type == "tool_use" and .name == "Bash")
295
+ | (.input.command // "") | match(route; "g") | .captures[0].string ]
296
+ | last // empty
297
+ ' "$transcript" 2>/dev/null
298
+ }
299
+
283
300
  # ---- entry check --------------------------------------------------------
284
301
  # The run guard below only arms once .sluice/run.json exists, and that file
285
302
  # only exists once the skill has been invoked. So the session that never
@@ -378,15 +395,7 @@ verify_gate() {
378
395
  [ -z "$unread" ] || return 0
379
396
  [ -f "$transcript" ] || return 0
380
397
 
381
- # Unparseable lines are dropped for the reason the entry check gives: the
382
- # harness is still appending to the transcript as this reads it.
383
- channel="$(jq -r -n -R "$route_def"'
384
- [ inputs | fromjson? // empty
385
- | select((.type == "assistant") and (((.isMeta == true) or (.isSidechain == true)) | not))
386
- | .message.content[]? | select(.type == "tool_use" and .name == "Bash")
387
- | (.input.command // "") | match(route; "g") | .captures[0].string ]
388
- | last // empty
389
- ' "$transcript" 2>/dev/null)" || return 0
398
+ channel="$(last_route)" || return 0
390
399
  case "$channel" in fast | main) ;; *) return 0 ;; esac
391
400
 
392
401
  # Unreadable content is unknown, not changed, as for the entry check.
@@ -486,6 +495,94 @@ fi
486
495
  [ -f "$STATUS" ] || exit 0
487
496
 
488
497
  resolve_run_tree
498
+
499
+ # ---- unopened-run gate ------------------------------------------------------
500
+ # Deep's two stops both come before any code, and the run guard below reads
501
+ # run.json, which only exists once both are behind the session. So the stretch
502
+ # where those stops are owed is the one stretch nothing held: a deep session
503
+ # that edits source before sign-off, or builds without ever opening a run,
504
+ # reached no gate at all. So does a session that closed its run and went on to
505
+ # other work under the same route.
506
+ #
507
+ # Until a run opens, a deep session writes its spec and its plan and nothing
508
+ # else, and both are new Markdown files. Anything else it changed and has not
509
+ # committed is refused: a file that is not Markdown, or a Markdown file that
510
+ # was already there, which is an edit rather than a design being written. New
511
+ # means absent from the session's base or never committed: a resume takes a
512
+ # fresh base with the unsigned spec already in it, and the revision that
513
+ # follows is still the design being written.
514
+ #
515
+ # Two things pass that a reader might expect held. Source committed before
516
+ # sign-off, because committed work cannot be told from a merged run's. And any
517
+ # change while a run is open in this tree, another session's included, because
518
+ # that run's guard is the one that answers there.
519
+ #
520
+ # Changed means against line 3 of the stamp, the commit of the tree as the
521
+ # session found it, so work in progress it opened on is never charged to it.
522
+ # Uncommitted means against HEAD: a run that merged and closed leaves its work
523
+ # committed, and its handback is not this gate's to refuse. A stamp with no
524
+ # base, or one gc has pruned, is unknown and stays silent, as in the test
525
+ # gate.
526
+ #
527
+ # Refused once per session, as the entry check is and for its reason: nothing
528
+ # in a tree says who changed it, and a design conversation runs several turns,
529
+ # so a wrong refusal repeated on each would teach its partner to ignore it.
530
+ unopened_gate() {
531
+ local base now uncommitted session offending marker
532
+ [ -z "$run_tree" ] || return 0
533
+ [ -n "$moved_tree" ] || return 0
534
+ [ -z "$unread" ] || return 0
535
+ [ -f "$transcript" ] || return 0
536
+ marker="$state_root/unopened/$sid"
537
+ [ -f "$marker" ] && return 0
538
+ [ "$(last_route)" = deep ] || return 0
539
+
540
+ base="$(sed -n '3p' "$moved_stamp" 2>/dev/null)"
541
+ [ -n "$base" ] || return 0
542
+ base="$(git -C "$moved_tree" rev-parse --verify --quiet "$base^{commit}" 2>/dev/null)" || return 0
543
+ [ -n "$base" ] || return 0
544
+ now="$(bash "$here/content-digest.sh" "$moved_tree" 2>/dev/null)" || return 0
545
+ [ -n "$now" ] || return 0
546
+
547
+ # quotepath off so a path outside ASCII is compared and matched as itself.
548
+ # git still quotes a path holding a control byte, a quote or a backslash,
549
+ # the same way in both lists, so the two still meet on it and the closing
550
+ # quote is allowed for after the extension.
551
+ uncommitted="$(git -C "$moved_tree" -c core.quotepath=false diff --name-status --no-renames HEAD "$now" 2>/dev/null)" || return 0
552
+ [ -n "$uncommitted" ] || return 0
553
+ # --raw for the modes: a nested repository, a submodule or a worktree cut
554
+ # under this tree, is one entry of mode 160000, and it is where work went
555
+ # rather than an edit to a file here.
556
+ session="$(git -C "$moved_tree" -c core.quotepath=false diff --raw --no-renames "$base" "$now" 2>/dev/null)" || return 0
557
+ offending="$(
558
+ {
559
+ printf '%s\n' "$uncommitted" | sed 's/^/U /'
560
+ printf '%s\n' "$session"
561
+ } | awk -F '\t' '
562
+ $1 == "U" { uncommitted[$3] = $2; next }
563
+ { split($1, entry, " ") }
564
+ entry[1] == ":160000" || entry[2] == "160000" { next }
565
+ ($2 in uncommitted) && !($2 ~ /\.md"?$/ && (entry[5] == "A" || uncommitted[$2] == "A")) { print $2 }
566
+ '
567
+ )"
568
+ [ -n "$offending" ] || return 0
569
+
570
+ mkdir -p "$state_root/unopened" 2>/dev/null || true
571
+ : >"$marker" 2>/dev/null || true
572
+ refuse "$(jq -rn --arg paths "$offending" '
573
+ ($paths | split("\n") | map(select(. != "") | gsub("[\u0000-\u001f\u007f]"; ""))) as $p
574
+ | "sluice: this session is routed deep, no run is open in this tree, and it has changed more than a new design or plan: "
575
+ + ($p[0:8] | join(", "))
576
+ + (if ($p | length) > 8 then ", and \(($p | length) - 8) more" else "" end)
577
+ + ". Until a run opens a deep session writes only its spec and its plan, as new Markdown files, because the design sign-off and pre-flight both come before any code. If either stop is still owed, take it now: end the turn on the sign-off or on the pre-flight questions, and make no further edits outside the design and plan until the answer is in. If both are behind you, open the run before Task 1 goes on: status.sh init, plan.sh import, then status.sh preflight with the answers. If this is work outside a deep run, route it as what it is, status.sh route fast or status.sh route main, and that channel checks it. If the change is not yours, say so and stop; this will not ask twice."
578
+ ')"
579
+ return 1
580
+ }
581
+
582
+ if ! unopened_gate; then
583
+ exit 0
584
+ fi
585
+
489
586
  [ -n "$run_tree" ] || exit 0
490
587
  tree="$run_tree"
491
588
 
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sluice",
3
- "version": "0.32.0",
4
- "description": "Routes work by change shape into four channels (bypass, fast, main, deep) and applies only the rules each channel needs, so a one-line fix does not pay the cost of a multi-subsystem build. Carries nine rules as one-liners in the router and the full treatment in references read only on friction. Deep runs read the repo before designing, map the spec's intent to its decisions, and check spec against intent and plan against spec with a fresh reader, with plan.sh validate enforcing that every decision is covered. Checks the finished plan with plan.sh validate rather than trusting it to memory, seeds the run state from it, keeps a deep run's task breakdown in .sluice/run.json so an opt-in statusline segment, the harness task list where the session has one, one status command and a SessionStart hook can answer where the run is (the hook prints a live run at every session start, compaction included), lists every live deep run and routed fast or main session on the machine in one board.sh view (drawn once, watched, or as JSON), and closes each run with a ledger read out of the session transcript: elapsed, tools, tokens, and what each dispatched agent cost where the transcript recorded it. Two Stop hooks hold a handback: one refuses a tree that moved since its last recorded check, the other refuses a changed existing test not proven to fail on the session's starting code (or recorded with a reason). Runs on Claude Code, Codex and Antigravity; stands down where the superpowers pipeline governs the repo.",
3
+ "version": "0.33.0",
4
+ "description": "Routes work by change shape into four channels (bypass, fast, main, deep) and applies only the rules each channel needs, so a one-line fix does not pay the cost of a multi-subsystem build. Carries nine rules as one-liners in the router and the full treatment in references read only on friction. Deep runs read the repo before designing, map the spec's intent to its decisions, and check spec against intent and plan against spec with a fresh reader, with plan.sh validate enforcing that every decision is covered. Checks the finished plan with plan.sh validate rather than trusting it to memory, seeds the run state from it, keeps a deep run's task breakdown in .sluice/run.json so an opt-in statusline segment, the harness task list where the session has one, one status command and a SessionStart hook can answer where the run is (the hook prints a live run at every session start, compaction included), lists every live deep run and routed fast or main session on the machine in one board.sh view (drawn once, watched, or as JSON), and closes each run with a ledger read out of the session transcript: elapsed, tools, tokens, and what each dispatched agent cost where the transcript recorded it. Two Stop hooks hold a handback: one refuses a tree that moved since its last recorded check, the other refuses a changed existing test not proven to fail on the session's starting code (or recorded with a reason). The Stop hook also holds deep's two stops: a deep session with no run open and uncommitted changes to anything but a new Markdown file is refused once. Runs on Claude Code, Codex and Antigravity; stands down where the superpowers pipeline governs the repo.",
5
5
  "author": "iceinvein",
6
6
  "type": "prompt",
7
7
  "tools": [