@cluesmith/codev 3.3.1 → 3.3.2
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/dashboard-dist/assets/index-D3XaKpZW.js.map +1 -1
- package/dist/agent-farm/cli.d.ts.map +1 -1
- package/dist/agent-farm/cli.js +52 -1
- package/dist/agent-farm/cli.js.map +1 -1
- package/dist/agent-farm/commands/reset/constants.d.ts +118 -0
- package/dist/agent-farm/commands/reset/constants.d.ts.map +1 -1
- package/dist/agent-farm/commands/reset/constants.js +118 -0
- package/dist/agent-farm/commands/reset/constants.js.map +1 -1
- package/dist/agent-farm/commands/reset/context.d.ts +18 -0
- package/dist/agent-farm/commands/reset/context.d.ts.map +1 -1
- package/dist/agent-farm/commands/reset/context.js +41 -0
- package/dist/agent-farm/commands/reset/context.js.map +1 -1
- package/dist/agent-farm/commands/reset/receipt.d.ts.map +1 -1
- package/dist/agent-farm/commands/reset/receipt.js +16 -5
- package/dist/agent-farm/commands/reset/receipt.js.map +1 -1
- package/dist/agent-farm/commands/reset/reorient.d.ts +1 -1
- package/dist/agent-farm/commands/reset/reorient.d.ts.map +1 -1
- package/dist/agent-farm/commands/reset/reorient.js +8 -1
- package/dist/agent-farm/commands/reset/reorient.js.map +1 -1
- package/dist/agent-farm/commands/reset/self.d.ts +335 -0
- package/dist/agent-farm/commands/reset/self.d.ts.map +1 -0
- package/dist/agent-farm/commands/reset/self.js +636 -0
- package/dist/agent-farm/commands/reset/self.js.map +1 -0
- package/dist/agent-farm/commands/reset.d.ts.map +1 -1
- package/dist/agent-farm/commands/reset.js +23 -18
- package/dist/agent-farm/commands/reset.js.map +1 -1
- package/dist/agent-farm/commands/self-refresh.d.ts +60 -0
- package/dist/agent-farm/commands/self-refresh.d.ts.map +1 -0
- package/dist/agent-farm/commands/self-refresh.js +506 -0
- package/dist/agent-farm/commands/self-refresh.js.map +1 -0
- package/dist/agent-farm/commands/send.d.ts.map +1 -1
- package/dist/agent-farm/commands/send.js +27 -2
- package/dist/agent-farm/commands/send.js.map +1 -1
- package/dist/agent-farm/commands/spawn.d.ts +7 -0
- package/dist/agent-farm/commands/spawn.d.ts.map +1 -1
- package/dist/agent-farm/commands/spawn.js +13 -1
- package/dist/agent-farm/commands/spawn.js.map +1 -1
- package/dist/agent-farm/lib/tower-client.d.ts +12 -0
- package/dist/agent-farm/lib/tower-client.d.ts.map +1 -1
- package/dist/agent-farm/lib/tower-client.js +12 -0
- package/dist/agent-farm/lib/tower-client.js.map +1 -1
- package/dist/agent-farm/servers/mailbox-delivery.d.ts +141 -13
- package/dist/agent-farm/servers/mailbox-delivery.d.ts.map +1 -1
- package/dist/agent-farm/servers/mailbox-delivery.js +172 -16
- package/dist/agent-farm/servers/mailbox-delivery.js.map +1 -1
- package/dist/agent-farm/servers/mailbox-wiring.d.ts +23 -1
- package/dist/agent-farm/servers/mailbox-wiring.d.ts.map +1 -1
- package/dist/agent-farm/servers/mailbox-wiring.js +91 -31
- package/dist/agent-farm/servers/mailbox-wiring.js.map +1 -1
- package/dist/agent-farm/servers/message-write.d.ts +58 -18
- package/dist/agent-farm/servers/message-write.d.ts.map +1 -1
- package/dist/agent-farm/servers/message-write.js +73 -28
- package/dist/agent-farm/servers/message-write.js.map +1 -1
- package/dist/agent-farm/servers/render-gate.d.ts +13 -0
- package/dist/agent-farm/servers/render-gate.d.ts.map +1 -1
- package/dist/agent-farm/servers/render-gate.js +21 -0
- package/dist/agent-farm/servers/render-gate.js.map +1 -1
- package/dist/agent-farm/servers/session-submit.d.ts +220 -27
- package/dist/agent-farm/servers/session-submit.d.ts.map +1 -1
- package/dist/agent-farm/servers/session-submit.js +333 -42
- package/dist/agent-farm/servers/session-submit.js.map +1 -1
- package/dist/agent-farm/servers/tower-routes.d.ts.map +1 -1
- package/dist/agent-farm/servers/tower-routes.js +114 -25
- package/dist/agent-farm/servers/tower-routes.js.map +1 -1
- package/dist/agent-farm/servers/tower-tunnel.d.ts.map +1 -1
- package/dist/agent-farm/servers/tower-tunnel.js +14 -0
- package/dist/agent-farm/servers/tower-tunnel.js.map +1 -1
- package/dist/agent-farm/types.d.ts +36 -1
- package/dist/agent-farm/types.d.ts.map +1 -1
- package/dist/agent-farm/utils/message-format.d.ts +60 -4
- package/dist/agent-farm/utils/message-format.d.ts.map +1 -1
- package/dist/agent-farm/utils/message-format.js +115 -22
- package/dist/agent-farm/utils/message-format.js.map +1 -1
- package/dist/agent-farm/utils/server-utils.d.ts +8 -2
- package/dist/agent-farm/utils/server-utils.d.ts.map +1 -1
- package/dist/agent-farm/utils/server-utils.js +19 -2
- package/dist/agent-farm/utils/server-utils.js.map +1 -1
- package/dist/commands/porch/context-refresh.d.ts +181 -0
- package/dist/commands/porch/context-refresh.d.ts.map +1 -0
- package/dist/commands/porch/context-refresh.js +270 -0
- package/dist/commands/porch/context-refresh.js.map +1 -0
- package/dist/commands/porch/index.d.ts +6 -0
- package/dist/commands/porch/index.d.ts.map +1 -1
- package/dist/commands/porch/index.js +46 -0
- package/dist/commands/porch/index.js.map +1 -1
- package/dist/commands/porch/next.d.ts +0 -9
- package/dist/commands/porch/next.d.ts.map +1 -1
- package/dist/commands/porch/next.js +133 -4
- package/dist/commands/porch/next.js.map +1 -1
- package/dist/commands/porch/protocol.d.ts.map +1 -1
- package/dist/commands/porch/protocol.js +102 -0
- package/dist/commands/porch/protocol.js.map +1 -1
- package/dist/commands/porch/types.d.ts +61 -0
- package/dist/commands/porch/types.d.ts.map +1 -1
- package/dist/lib/self-refresh-invocation.d.ts +60 -0
- package/dist/lib/self-refresh-invocation.d.ts.map +1 -0
- package/dist/lib/self-refresh-invocation.js +64 -0
- package/dist/lib/self-refresh-invocation.js.map +1 -0
- package/dist/lib/test-env.d.ts +50 -0
- package/dist/lib/test-env.d.ts.map +1 -1
- package/dist/lib/test-env.js +76 -0
- package/dist/lib/test-env.js.map +1 -1
- package/package.json +4 -4
- package/skeleton/.claude/skills/arch-save/SKILL.md +8 -2
- package/skeleton/.claude/skills/builder-refresh/SKILL.md +138 -0
- package/skeleton/.codex/skills/arch-save/SKILL.md +8 -2
- package/skeleton/.codex/skills/builder-refresh/SKILL.md +138 -0
- package/skeleton/protocol-schema.json +17 -0
- package/skeleton/protocols/air/protocol.json +1 -1
- package/skeleton/protocols/aspir/protocol.json +5 -1
- package/skeleton/protocols/bugfix/protocol.json +1 -1
- package/skeleton/protocols/experiment/protocol.json +1 -1
- package/skeleton/protocols/maintain/protocol.json +1 -1
- package/skeleton/protocols/pir/protocol.json +1 -1
- package/skeleton/protocols/protocol-schema.json +17 -0
- package/skeleton/protocols/research/protocol.json +1 -1
- package/skeleton/protocols/spike/protocol.json +1 -1
- package/skeleton/protocols/spir/protocol.json +5 -1
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: builder-refresh
|
|
3
|
+
description: Refresh a builder's own context at a protocol boundary — save working state, verify it, clear, and re-orient. Use when porch emits a context-refresh task, or the builder is told to "refresh your context" / "run a self-refresh". A builder does not invoke this autonomously mid-task; porch chooses the moment. Counterpart to the architect's /arch-save.
|
|
4
|
+
argument-hint: "(none — porch's refresh task supplies the commands)"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# /builder-refresh — save, clear, and come back knowing where you are
|
|
8
|
+
|
|
9
|
+
You are a builder that has reached a protocol boundary. Your context can be discarded
|
|
10
|
+
here safely, because everything that matters is already on disk: the spec, the plan,
|
|
11
|
+
`status.yaml`, your thread narrative, and git history. A fresh context re-orients from
|
|
12
|
+
those artifacts rather than from memory.
|
|
13
|
+
|
|
14
|
+
**The enforcement is in the command, not in this document.** `afx self-refresh` refuses to
|
|
15
|
+
clear on an unverified save, refuses when the re-entry cannot be scheduled, and refuses
|
|
16
|
+
when your worktree has uncommitted tracked changes. This skill sequences the steps and
|
|
17
|
+
explains the judgement calls; it cannot and does not decide whether the clear is safe.
|
|
18
|
+
|
|
19
|
+
## When NOT to run this
|
|
20
|
+
|
|
21
|
+
**Porch chooses the moment. You do not.** Run this when porch's refresh task tells you to,
|
|
22
|
+
or when the architect directs it. Do not invoke it mid-task on your own judgement — a
|
|
23
|
+
boundary is a point a fresh context can resume *from*, and a mid-task snapshot resumes into
|
|
24
|
+
confusion.
|
|
25
|
+
|
|
26
|
+
If you are not at a boundary and think you need a refresh anyway, say so to the architect
|
|
27
|
+
rather than doing it: `afx send architect "..."`.
|
|
28
|
+
|
|
29
|
+
## The procedure
|
|
30
|
+
|
|
31
|
+
### 1. Use the commands porch gave you
|
|
32
|
+
|
|
33
|
+
Porch's refresh task contains the exact two commands for this boundary, including the
|
|
34
|
+
`--boundary` flag. **Run those, verbatim.**
|
|
35
|
+
|
|
36
|
+
Do not retype them from memory and do not omit the flag. `--boundary` binds the challenge
|
|
37
|
+
to the boundary it was issued at, so a challenge left behind by an aborted refresh cannot
|
|
38
|
+
be used to clear you at a *later* boundary, against a save describing work that has since
|
|
39
|
+
moved on. That guard has been silently disabled twice by an instruction that dropped the
|
|
40
|
+
flag, which is why this document deliberately does not restate the commands.
|
|
41
|
+
|
|
42
|
+
If you arrived here without a porch task — an architect-directed refresh, say — there is no
|
|
43
|
+
boundary to bind, and the flagless form is correct. Run `afx self-refresh --help` for the
|
|
44
|
+
exact spelling rather than guessing it.
|
|
45
|
+
|
|
46
|
+
### 2. Write your working state
|
|
47
|
+
|
|
48
|
+
The first command prints a save request naming a file and a marker line. Write that file.
|
|
49
|
+
|
|
50
|
+
**The marker must be the FIRST LINE**, reproduced exactly. A save whose nonce appears
|
|
51
|
+
further down is refused — that check exists because echoing the request back into the file
|
|
52
|
+
otherwise passed every gate, and echoing instructions is something agents do by accident.
|
|
53
|
+
|
|
54
|
+
**Write for a cold reader** — a competent agent that wakes up with your worktree, your
|
|
55
|
+
branch, and no memory of this conversation. Most of your state is already on disk, so do
|
|
56
|
+
not restate the spec or the plan. Carry only what the artifacts do not contain:
|
|
57
|
+
|
|
58
|
+
- **receipts** — what is done and *verified*, with paths and commit hashes, distinguishing
|
|
59
|
+
"written" from "verified";
|
|
60
|
+
- **deviations** from the plan, and why;
|
|
61
|
+
- **flaky or skipped tests**, and what you did about them;
|
|
62
|
+
- **deferred work**, and the reason;
|
|
63
|
+
- **standing orders** from the architect you are still bound by, including anything you
|
|
64
|
+
were told NOT to do;
|
|
65
|
+
- **the next concrete action**.
|
|
66
|
+
|
|
67
|
+
Pointers, not prose. The save has a minimum size, and it is not a word count to pad — a
|
|
68
|
+
file below it is indistinguishable from a stub. If you genuinely have less than that to
|
|
69
|
+
say, you are probably omitting receipts or standing orders.
|
|
70
|
+
|
|
71
|
+
### 3. Run the execute command, then stop
|
|
72
|
+
|
|
73
|
+
The second command verifies your save, writes a re-orientation to disk, schedules your
|
|
74
|
+
re-entry, and clears you — in that order, and only if every step succeeds.
|
|
75
|
+
|
|
76
|
+
**Then end your turn.** Do not start new work. The clear takes effect when the turn ends.
|
|
77
|
+
|
|
78
|
+
## If it refuses
|
|
79
|
+
|
|
80
|
+
Most refusals happen **before** anything destructive, and those leave your context
|
|
81
|
+
untouched. One does not. Read which you got.
|
|
82
|
+
|
|
83
|
+
### Pre-clear refusals — your context is intact
|
|
84
|
+
|
|
85
|
+
| Refusal | What it means |
|
|
86
|
+
|---|---|
|
|
87
|
+
| state file missing / too small / wrong nonce | Your save did not satisfy the gate — check the marker is on line 1 |
|
|
88
|
+
| worktree has uncommitted tracked changes | Commit first; a refreshed context re-orients from git, so uncommitted work is invisible to it |
|
|
89
|
+
| Tower is not running, or did not schedule the re-entry | Clearing would strand you, so it refused |
|
|
90
|
+
| challenge missing / already consumed / for a different boundary | Run the begin step again |
|
|
91
|
+
| invalid parameters | A flag is out of range — nothing was read or written |
|
|
92
|
+
| challenge could not be marked consumed | Nothing was cleared, but a re-entry **is** already queued and will arrive; ignore it. Retrying queues a second one |
|
|
93
|
+
|
|
94
|
+
For any of these: **report it and carry on.**
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
afx send architect "Context refresh refused at <boundary>: <the reason it printed>"
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Then run `porch next` for your normal tasks. **The refresh never blocks your work** — the
|
|
101
|
+
boundary is recorded as consumed either way, so a failed refresh costs you some context and
|
|
102
|
+
nothing else.
|
|
103
|
+
|
|
104
|
+
### `clear-failed` — you cannot assume anything
|
|
105
|
+
|
|
106
|
+
If the command reports that the clear was attempted but **may still have landed**, do not
|
|
107
|
+
treat that as a pre-clear refusal. Sending `/clear` can succeed on the wire and still report
|
|
108
|
+
an error, so from inside this turn it is genuinely unknown whether your context survives.
|
|
109
|
+
|
|
110
|
+
- A re-entry message **is** already queued and will arrive shortly. If your context was
|
|
111
|
+
cleared, that message is your re-orientation. If it was not, the message is harmless and
|
|
112
|
+
can be ignored.
|
|
113
|
+
- Do not start new work in this state.
|
|
114
|
+
- Tell the architect explicitly that the outcome is ambiguous:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
afx send architect "Self-refresh clear-failed at <boundary> — clear may or may not have landed; re-entry is queued"
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## After the clear
|
|
121
|
+
|
|
122
|
+
A re-entry message arrives shortly, identifying itself as an automatic context refresh. It
|
|
123
|
+
carries your identity, protocol, project, worktree and branch, and points at
|
|
124
|
+
`.builder-reorient.md` — the full spawn-quality frame, on disk.
|
|
125
|
+
|
|
126
|
+
It will tell you to run `porch next`. Do that; porch's state is untouched by the clear and
|
|
127
|
+
its next task emission *is* your re-orientation.
|
|
128
|
+
|
|
129
|
+
**If the re-entry never arrives**, nothing is lost. `.builder-reorient.md` is on disk and
|
|
130
|
+
the architect can send you back with one message. Say so if you notice.
|
|
131
|
+
|
|
132
|
+
## What this does not do
|
|
133
|
+
|
|
134
|
+
- It does not write `status.yaml`. Only porch does, and the boundary is already recorded
|
|
135
|
+
there before you are asked to refresh.
|
|
136
|
+
- It does not decide *whether* to refresh. Porch decided that.
|
|
137
|
+
- It does not retry. A boundary is refreshed at most once, so a refusal means this boundary
|
|
138
|
+
simply does not get a refresh.
|
|
@@ -107,8 +107,14 @@ guarantee about the clear's completion. If the timing is wrong the re-init arriv
|
|
|
107
107
|
wrong moment, which costs one manual message (see below) and nothing else. That is the
|
|
108
108
|
whole reason this cycle can be built on a delay rather than on machinery.
|
|
109
109
|
|
|
110
|
-
Delayed sends are
|
|
111
|
-
|
|
110
|
+
Delayed sends **are persisted**. The body is written to the durable mailbox at request time
|
|
111
|
+
with a `not_before` timestamp, so Tower keeps no timer for it and a restart inside the window
|
|
112
|
+
does not lose it — the re-init is delivered once the delay passes. The one thing a restart does
|
|
113
|
+
drop is the Ctrl+C nudge of a delayed `--interrupt`, which this cycle does not use.
|
|
114
|
+
|
|
115
|
+
That removes a failure mode this section used to warn about, but not the need for the recovery
|
|
116
|
+
path below: delivery still waits on an empty prompt, so a re-init can arrive late rather than
|
|
117
|
+
never.
|
|
112
118
|
|
|
113
119
|
**If this send fails, do not end your turn.** Step 4 queued the `/clear`, but it does not
|
|
114
120
|
take effect until your turn ends — so at this moment you still have your full context and
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: builder-refresh
|
|
3
|
+
description: Refresh a builder's own context at a protocol boundary — save working state, verify it, clear, and re-orient. Use when porch emits a context-refresh task, or the builder is told to "refresh your context" / "run a self-refresh". A builder does not invoke this autonomously mid-task; porch chooses the moment. Counterpart to the architect's /arch-save.
|
|
4
|
+
argument-hint: "(none — porch's refresh task supplies the commands)"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# /builder-refresh — save, clear, and come back knowing where you are
|
|
8
|
+
|
|
9
|
+
You are a builder that has reached a protocol boundary. Your context can be discarded
|
|
10
|
+
here safely, because everything that matters is already on disk: the spec, the plan,
|
|
11
|
+
`status.yaml`, your thread narrative, and git history. A fresh context re-orients from
|
|
12
|
+
those artifacts rather than from memory.
|
|
13
|
+
|
|
14
|
+
**The enforcement is in the command, not in this document.** `afx self-refresh` refuses to
|
|
15
|
+
clear on an unverified save, refuses when the re-entry cannot be scheduled, and refuses
|
|
16
|
+
when your worktree has uncommitted tracked changes. This skill sequences the steps and
|
|
17
|
+
explains the judgement calls; it cannot and does not decide whether the clear is safe.
|
|
18
|
+
|
|
19
|
+
## When NOT to run this
|
|
20
|
+
|
|
21
|
+
**Porch chooses the moment. You do not.** Run this when porch's refresh task tells you to,
|
|
22
|
+
or when the architect directs it. Do not invoke it mid-task on your own judgement — a
|
|
23
|
+
boundary is a point a fresh context can resume *from*, and a mid-task snapshot resumes into
|
|
24
|
+
confusion.
|
|
25
|
+
|
|
26
|
+
If you are not at a boundary and think you need a refresh anyway, say so to the architect
|
|
27
|
+
rather than doing it: `afx send architect "..."`.
|
|
28
|
+
|
|
29
|
+
## The procedure
|
|
30
|
+
|
|
31
|
+
### 1. Use the commands porch gave you
|
|
32
|
+
|
|
33
|
+
Porch's refresh task contains the exact two commands for this boundary, including the
|
|
34
|
+
`--boundary` flag. **Run those, verbatim.**
|
|
35
|
+
|
|
36
|
+
Do not retype them from memory and do not omit the flag. `--boundary` binds the challenge
|
|
37
|
+
to the boundary it was issued at, so a challenge left behind by an aborted refresh cannot
|
|
38
|
+
be used to clear you at a *later* boundary, against a save describing work that has since
|
|
39
|
+
moved on. That guard has been silently disabled twice by an instruction that dropped the
|
|
40
|
+
flag, which is why this document deliberately does not restate the commands.
|
|
41
|
+
|
|
42
|
+
If you arrived here without a porch task — an architect-directed refresh, say — there is no
|
|
43
|
+
boundary to bind, and the flagless form is correct. Run `afx self-refresh --help` for the
|
|
44
|
+
exact spelling rather than guessing it.
|
|
45
|
+
|
|
46
|
+
### 2. Write your working state
|
|
47
|
+
|
|
48
|
+
The first command prints a save request naming a file and a marker line. Write that file.
|
|
49
|
+
|
|
50
|
+
**The marker must be the FIRST LINE**, reproduced exactly. A save whose nonce appears
|
|
51
|
+
further down is refused — that check exists because echoing the request back into the file
|
|
52
|
+
otherwise passed every gate, and echoing instructions is something agents do by accident.
|
|
53
|
+
|
|
54
|
+
**Write for a cold reader** — a competent agent that wakes up with your worktree, your
|
|
55
|
+
branch, and no memory of this conversation. Most of your state is already on disk, so do
|
|
56
|
+
not restate the spec or the plan. Carry only what the artifacts do not contain:
|
|
57
|
+
|
|
58
|
+
- **receipts** — what is done and *verified*, with paths and commit hashes, distinguishing
|
|
59
|
+
"written" from "verified";
|
|
60
|
+
- **deviations** from the plan, and why;
|
|
61
|
+
- **flaky or skipped tests**, and what you did about them;
|
|
62
|
+
- **deferred work**, and the reason;
|
|
63
|
+
- **standing orders** from the architect you are still bound by, including anything you
|
|
64
|
+
were told NOT to do;
|
|
65
|
+
- **the next concrete action**.
|
|
66
|
+
|
|
67
|
+
Pointers, not prose. The save has a minimum size, and it is not a word count to pad — a
|
|
68
|
+
file below it is indistinguishable from a stub. If you genuinely have less than that to
|
|
69
|
+
say, you are probably omitting receipts or standing orders.
|
|
70
|
+
|
|
71
|
+
### 3. Run the execute command, then stop
|
|
72
|
+
|
|
73
|
+
The second command verifies your save, writes a re-orientation to disk, schedules your
|
|
74
|
+
re-entry, and clears you — in that order, and only if every step succeeds.
|
|
75
|
+
|
|
76
|
+
**Then end your turn.** Do not start new work. The clear takes effect when the turn ends.
|
|
77
|
+
|
|
78
|
+
## If it refuses
|
|
79
|
+
|
|
80
|
+
Most refusals happen **before** anything destructive, and those leave your context
|
|
81
|
+
untouched. One does not. Read which you got.
|
|
82
|
+
|
|
83
|
+
### Pre-clear refusals — your context is intact
|
|
84
|
+
|
|
85
|
+
| Refusal | What it means |
|
|
86
|
+
|---|---|
|
|
87
|
+
| state file missing / too small / wrong nonce | Your save did not satisfy the gate — check the marker is on line 1 |
|
|
88
|
+
| worktree has uncommitted tracked changes | Commit first; a refreshed context re-orients from git, so uncommitted work is invisible to it |
|
|
89
|
+
| Tower is not running, or did not schedule the re-entry | Clearing would strand you, so it refused |
|
|
90
|
+
| challenge missing / already consumed / for a different boundary | Run the begin step again |
|
|
91
|
+
| invalid parameters | A flag is out of range — nothing was read or written |
|
|
92
|
+
| challenge could not be marked consumed | Nothing was cleared, but a re-entry **is** already queued and will arrive; ignore it. Retrying queues a second one |
|
|
93
|
+
|
|
94
|
+
For any of these: **report it and carry on.**
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
afx send architect "Context refresh refused at <boundary>: <the reason it printed>"
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Then run `porch next` for your normal tasks. **The refresh never blocks your work** — the
|
|
101
|
+
boundary is recorded as consumed either way, so a failed refresh costs you some context and
|
|
102
|
+
nothing else.
|
|
103
|
+
|
|
104
|
+
### `clear-failed` — you cannot assume anything
|
|
105
|
+
|
|
106
|
+
If the command reports that the clear was attempted but **may still have landed**, do not
|
|
107
|
+
treat that as a pre-clear refusal. Sending `/clear` can succeed on the wire and still report
|
|
108
|
+
an error, so from inside this turn it is genuinely unknown whether your context survives.
|
|
109
|
+
|
|
110
|
+
- A re-entry message **is** already queued and will arrive shortly. If your context was
|
|
111
|
+
cleared, that message is your re-orientation. If it was not, the message is harmless and
|
|
112
|
+
can be ignored.
|
|
113
|
+
- Do not start new work in this state.
|
|
114
|
+
- Tell the architect explicitly that the outcome is ambiguous:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
afx send architect "Self-refresh clear-failed at <boundary> — clear may or may not have landed; re-entry is queued"
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## After the clear
|
|
121
|
+
|
|
122
|
+
A re-entry message arrives shortly, identifying itself as an automatic context refresh. It
|
|
123
|
+
carries your identity, protocol, project, worktree and branch, and points at
|
|
124
|
+
`.builder-reorient.md` — the full spawn-quality frame, on disk.
|
|
125
|
+
|
|
126
|
+
It will tell you to run `porch next`. Do that; porch's state is untouched by the clear and
|
|
127
|
+
its next task emission *is* your re-orientation.
|
|
128
|
+
|
|
129
|
+
**If the re-entry never arrives**, nothing is lost. `.builder-reorient.md` is on disk and
|
|
130
|
+
the architect can send you back with one message. Say so if you notice.
|
|
131
|
+
|
|
132
|
+
## What this does not do
|
|
133
|
+
|
|
134
|
+
- It does not write `status.yaml`. Only porch does, and the boundary is already recorded
|
|
135
|
+
there before you are asked to refresh.
|
|
136
|
+
- It does not decide *whether* to refresh. Porch decided that.
|
|
137
|
+
- It does not retry. A boundary is refreshed at most once, so a refusal means this boundary
|
|
138
|
+
simply does not get a refresh.
|
|
@@ -39,6 +39,23 @@
|
|
|
39
39
|
"description": "Signals that can be emitted during protocol execution",
|
|
40
40
|
"additionalProperties": { "$ref": "#/$defs/signal" }
|
|
41
41
|
},
|
|
42
|
+
"context_refresh": {
|
|
43
|
+
"type": "object",
|
|
44
|
+
"description": "Boundaries at which builders automatically refresh their context (Spec 1470). Absent means no refreshes.",
|
|
45
|
+
"additionalProperties": false,
|
|
46
|
+
"properties": {
|
|
47
|
+
"on_enter": {
|
|
48
|
+
"type": "array",
|
|
49
|
+
"description": "Protocol phase ids to refresh on entry to. Each must name a phase this protocol declares.",
|
|
50
|
+
"uniqueItems": true,
|
|
51
|
+
"items": { "type": "string" }
|
|
52
|
+
},
|
|
53
|
+
"on_plan_phase_advance": {
|
|
54
|
+
"type": "boolean",
|
|
55
|
+
"description": "Refresh when advancing from one plan phase to the next. Requires a 'per_plan_phase' phase. Excludes the first plan phase, which coincides with entering the phase itself."
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
},
|
|
42
59
|
"phase_completion": {
|
|
43
60
|
"type": "object",
|
|
44
61
|
"description": "Checks run when a plan phase completes",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$schema": "
|
|
2
|
+
"$schema": "../protocol-schema.json",
|
|
3
3
|
"name": "aspir",
|
|
4
4
|
"version": "1.0.0",
|
|
5
5
|
"description": "ASPIR: Autonomous SPIR — Specify → Plan → Implement → Review without human approval gates",
|
|
@@ -8,6 +8,10 @@
|
|
|
8
8
|
"required": false,
|
|
9
9
|
"default_for": ["--project", "-p"]
|
|
10
10
|
},
|
|
11
|
+
"context_refresh": {
|
|
12
|
+
"on_enter": ["plan", "implement", "review"],
|
|
13
|
+
"on_plan_phase_advance": true
|
|
14
|
+
},
|
|
11
15
|
"phases": [
|
|
12
16
|
{
|
|
13
17
|
"id": "specify",
|
|
@@ -33,6 +33,23 @@
|
|
|
33
33
|
"hooks": {
|
|
34
34
|
"$ref": "#/definitions/protocolHooks"
|
|
35
35
|
},
|
|
36
|
+
"context_refresh": {
|
|
37
|
+
"type": "object",
|
|
38
|
+
"description": "Boundaries at which builders automatically refresh their context (Spec 1470). Absent means no refreshes.",
|
|
39
|
+
"additionalProperties": false,
|
|
40
|
+
"properties": {
|
|
41
|
+
"on_enter": {
|
|
42
|
+
"type": "array",
|
|
43
|
+
"description": "Protocol phase ids to refresh on entry to. Each must name a phase this protocol declares.",
|
|
44
|
+
"uniqueItems": true,
|
|
45
|
+
"items": { "type": "string" }
|
|
46
|
+
},
|
|
47
|
+
"on_plan_phase_advance": {
|
|
48
|
+
"type": "boolean",
|
|
49
|
+
"description": "Refresh when advancing from one plan phase to the next. Requires a 'per_plan_phase' phase. Excludes the first plan phase, which coincides with entering the phase itself."
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
},
|
|
36
53
|
"signals": {
|
|
37
54
|
"type": "object",
|
|
38
55
|
"description": "Signal definitions for state transitions",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$schema": "
|
|
2
|
+
"$schema": "../protocol-schema.json",
|
|
3
3
|
"name": "spir",
|
|
4
4
|
"alias": "spider",
|
|
5
5
|
"version": "2.2.0",
|
|
@@ -9,6 +9,10 @@
|
|
|
9
9
|
"required": false,
|
|
10
10
|
"default_for": ["--project", "-p"]
|
|
11
11
|
},
|
|
12
|
+
"context_refresh": {
|
|
13
|
+
"on_enter": ["plan", "implement", "review"],
|
|
14
|
+
"on_plan_phase_advance": true
|
|
15
|
+
},
|
|
12
16
|
"phases": [
|
|
13
17
|
{
|
|
14
18
|
"id": "specify",
|