@tduyng/pi-devos 0.0.0-stage → 0.14.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/CHANGELOG.md +1421 -0
- package/LICENSE +201 -0
- package/README.md +206 -2
- package/package.json +44 -4
- package/plugins/devos/agents/reader.md +27 -0
- package/plugins/devos/agents/verifier.md +155 -0
- package/plugins/devos/pi/extension/devos.ts +605 -0
- package/plugins/devos/scripts/check-evidence-router.sh +140 -0
- package/plugins/devos/scripts/evidence-router.py +254 -0
- package/plugins/devos/scripts/gates/check-dod-core.sh +285 -0
- package/plugins/devos/scripts/gates/check-dod.sh +38 -0
- package/plugins/devos/scripts/gates/check-implementation-boundary.sh +99 -0
- package/plugins/devos/scripts/gates/check-port-source.sh +134 -0
- package/plugins/devos/scripts/gates/check-report-locations.sh +148 -0
- package/plugins/devos/scripts/gates/check-scenario-coverage.sh +104 -0
- package/plugins/devos/scripts/gates/gate-check.mjs +204 -0
- package/plugins/devos/scripts/gates/phase-gate.sh +208 -0
- package/plugins/devos/scripts/gates/plan-template-check.py +141 -0
- package/plugins/devos/scripts/gates/run-gate.sh +148 -0
- package/plugins/devos/scripts/gates/spec-contract.sh +19 -0
- package/plugins/devos/scripts/gates/spec-template-check.py +152 -0
- package/plugins/devos/scripts/gates/suite/01-dod.sh +485 -0
- package/plugins/devos/scripts/gates/suite/02-integrity.sh +310 -0
- package/plugins/devos/scripts/gates/suite/03-archetype.sh +255 -0
- package/plugins/devos/scripts/gates/suite/04-spec-validator.sh +183 -0
- package/plugins/devos/scripts/gates/suite/05-requires.sh +360 -0
- package/plugins/devos/scripts/gates/suite/06-clarify-adapters.sh +435 -0
- package/plugins/devos/scripts/gates/suite/07-lint-evals.sh +350 -0
- package/plugins/devos/scripts/gates/suite/08-converge.sh +591 -0
- package/plugins/devos/scripts/gates/suite/09-quality.sh +516 -0
- package/plugins/devos/scripts/gates/suite/10-eval-harness.sh +679 -0
- package/plugins/devos/scripts/gates/test-gates.sh +76 -0
- package/plugins/devos/scripts/gates/test-integrity-rubric.sh +152 -0
- package/plugins/devos/scripts/gates/test-phase-gate.sh +116 -0
- package/plugins/devos/skills/absorb/SKILL.md +75 -0
- package/plugins/devos/skills/absorb/references/distill.md +67 -0
- package/plugins/devos/skills/absorb/scripts/check-refs.sh +108 -0
- package/plugins/devos/skills/absorb/scripts/knowledge.py +258 -0
- package/plugins/devos/skills/build/SKILL.md +71 -0
- package/plugins/devos/skills/build/references/advanced-routing.md +19 -0
- package/plugins/devos/skills/build/references/defect.md +17 -0
- package/plugins/devos/skills/build/references/exposure.md +28 -0
- package/plugins/devos/skills/build/references/hard.md +39 -0
- package/plugins/devos/skills/build/references/refactor.md +66 -0
- package/plugins/devos/skills/build/references/routes.md +56 -0
- package/plugins/devos/skills/build/references/scale.md +84 -0
- package/plugins/devos/skills/build/references/spike.md +19 -0
- package/plugins/devos/skills/build/scripts/construct-census.py +204 -0
- package/plugins/devos/skills/build/scripts/dep-order.py +297 -0
- package/plugins/devos/skills/build/scripts/ledger.sh +228 -0
- package/plugins/devos/skills/build/scripts/route.sh +5 -0
- package/plugins/devos/skills/build/scripts/secret-scan.sh +121 -0
- package/plugins/devos/skills/build/scripts/toolchain-preflight.py +302 -0
- package/plugins/devos/skills/frame/SKILL.md +54 -0
- package/plugins/devos/skills/frame/references/template.md +115 -0
- package/plugins/devos/skills/frame/scripts/survey.sh +44 -0
- package/plugins/devos/skills/implement/SKILL.md +36 -0
- package/plugins/devos/skills/implement/references/conditional-plan.md +17 -0
- package/plugins/devos/skills/implement/references/debug-loop.md +7 -0
- package/plugins/devos/skills/implement/references/dod.md +37 -0
- package/plugins/devos/skills/implement/references/implement.md +54 -0
- package/plugins/devos/skills/implement/references/manual-gates.md +16 -0
- package/plugins/devos/skills/implement/references/plan.md +142 -0
- package/plugins/devos/skills/implement/references/resume.md +9 -0
- package/plugins/devos/skills/implement/references/scale.md +86 -0
- package/plugins/devos/skills/implement/references/verify-close.md +62 -0
- package/plugins/devos/skills/implement/references/visual-verification.md +7 -0
- package/plugins/devos/skills/implement/scripts/check-converge.sh +147 -0
- package/plugins/devos/skills/implement/scripts/equivalence-check.sh +140 -0
- package/plugins/devos/skills/implement/scripts/manifest-queue.sh +185 -0
- package/plugins/devos/skills/implement/scripts/ops-log.sh +58 -0
- package/plugins/devos/skills/implement/scripts/pilot-consistency.py +173 -0
- package/plugins/devos/skills/implement/scripts/validate-spec.sh +220 -0
- package/plugins/devos/skills/init/SKILL.md +100 -0
- package/plugins/devos/skills/init/references/archetype-sections.md +15 -0
- package/plugins/devos/skills/init/references/context.md +42 -0
- package/plugins/devos/skills/init/references/conventions-template.md +153 -0
- package/plugins/devos/skills/init/references/reverse-engineer.md +3 -0
- package/plugins/devos/skills/init/references/rule-format.md +58 -0
- package/plugins/devos/skills/init/references/shape-model.md +29 -0
- package/plugins/devos/skills/init/scripts/detect-archetype.py +461 -0
- package/plugins/devos/skills/init/scripts/render-rule.py +114 -0
- package/plugins/devos/skills/init/scripts/reverse-engineer.sh +162 -0
- package/plugins/devos/skills/learn/SKILL.md +29 -0
- package/plugins/devos/skills/learn/references/destinations.md +43 -0
- package/plugins/devos/skills/learn/references/scoring.md +26 -0
- package/plugins/devos/skills/review/SKILL.md +54 -0
- package/plugins/devos/skills/review/references/comments.md +13 -0
- package/plugins/devos/skills/review/references/gaps.md +26 -0
- package/plugins/devos/skills/review/references/reviewer.md +124 -0
- package/plugins/devos/skills/review/references/routing.md +35 -0
- package/plugins/devos/skills/review/scripts/__pycache__/prepare.cpython-313.pyc +0 -0
- package/plugins/devos/skills/review/scripts/prepare.py +763 -0
- package/plugins/devos/skills/spec/SKILL.md +57 -0
- package/plugins/devos/skills/spec/references/prototype.md +21 -0
- package/plugins/devos/skills/spec/references/question-craft.md +47 -0
- package/plugins/devos/skills/spec/references/roadmap-link.md +5 -0
- package/plugins/devos/skills/spec/references/write-spec.md +128 -0
- package/plugins/devos/skills/spec/scripts/clarify.sh +173 -0
- package/plugins/devos/skills/status/SKILL.md +67 -0
- package/plugins/devos/skills/status/references/cost.md +38 -0
- package/plugins/devos/skills/status/scripts/artifact-budgets.sh +88 -0
- package/plugins/devos/skills/status/scripts/check-requires.py +556 -0
- package/plugins/devos/skills/status/scripts/context-cost.sh +89 -0
- package/plugins/devos/skills/status/scripts/convention-usage.sh +184 -0
- package/plugins/devos/skills/status/scripts/findings-summary.sh +112 -0
- package/plugins/devos/skills/status/scripts/quality-correlation.sh +259 -0
- package/plugins/devos/skills/status/scripts/sizing-calibration.sh +71 -0
- package/plugins/devos/skills/status/scripts/spec-diff.sh +137 -0
|
@@ -0,0 +1,605 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
// DevOS gates for Pi, the one real-code piece of this adapter.
|
|
3
|
+
//
|
|
4
|
+
// Verified against the installed @earendil-works/pi-coding-agent 1.4.0 type
|
|
5
|
+
// definitions on this machine (dist/core/extensions/types.d.ts and
|
|
6
|
+
// dist/core/tools/{edit,write}.js), not against docs:
|
|
7
|
+
//
|
|
8
|
+
// - test-integrity: `tool_call` fires before every tool runs and its result
|
|
9
|
+
// type is `ToolCallEventResult { block?, reason?, terminate? }`. Returning
|
|
10
|
+
// `{block: true}` denies the call outright, so this gate is a HARD BLOCK
|
|
11
|
+
// here, the same guarantee Claude Code's PreToolUse exit-2 gives. Unlike
|
|
12
|
+
// every other adapter, the payload
|
|
13
|
+
// field names are typed rather than guessed: `edit` is
|
|
14
|
+
// `{path, edits: [{oldText, newText}]}` and `write` is `{path, content}`.
|
|
15
|
+
// - Definition-of-Done: no blocking turn-end event exists
|
|
16
|
+
// (`turn_end` / `agent_end` / `agent_settled` all return void), so this
|
|
17
|
+
// gate enforces at the close protocol's own chokepoint instead: a
|
|
18
|
+
// `tool_call` hard block denies `ops-log.sh <spec> closed` while the spec
|
|
19
|
+
// lacks its verification report. On top of that, `turn_end` carries `message` directly
|
|
20
|
+
// and `pi.sendUserMessage()` injects a follow-up correction for a false
|
|
21
|
+
// DONE claim, as a backstop with a progress-aware budget.
|
|
22
|
+
//
|
|
23
|
+
// No import from the pi package or typebox: this file is installed from a
|
|
24
|
+
// git checkout that has no node_modules, so a bare-specifier import would not
|
|
25
|
+
// resolve (the test runs the file under plain node). registerTool accepts a
|
|
26
|
+
// plain JSON Schema object; verified live against 0.84.2 that pi registers it,
|
|
27
|
+
// validates tool calls against it and executes it. Node builtins only, same
|
|
28
|
+
// posture as the herdr integration's extension.
|
|
29
|
+
import fs from "node:fs";
|
|
30
|
+
import os from "node:os";
|
|
31
|
+
import path from "node:path";
|
|
32
|
+
import { spawnSync } from "node:child_process";
|
|
33
|
+
import { fileURLToPath } from "node:url";
|
|
34
|
+
|
|
35
|
+
// The extension ships inside the plugin at plugins/devos/pi/extension, which is
|
|
36
|
+
// four levels below the repo root. GATES must point at this DevOS checkout
|
|
37
|
+
// wherever `pi install` resolved the package from.
|
|
38
|
+
const HERE = path.dirname(fs.realpathSync(fileURLToPath(import.meta.url)));
|
|
39
|
+
const DEVOS_ROOT = path.join(HERE, "../../../..");
|
|
40
|
+
const GATES = path.join(DEVOS_ROOT, "plugins/devos/scripts/gates");
|
|
41
|
+
|
|
42
|
+
// Claude Code expands `${CLAUDE_PLUGIN_ROOT}` (a plugin's root) and
|
|
43
|
+
// `${CLAUDE_SKILL_DIR}` (the running skill's own directory); Pi expands
|
|
44
|
+
// neither, so skill lines carrying them reach the shell literally. Nine
|
|
45
|
+
// skills use them. Each variable gets a candidate list, and a reference
|
|
46
|
+
// resolves to the first candidate where the referenced path actually exists.
|
|
47
|
+
// DevOS ships one plugin, so the list has one root.
|
|
48
|
+
const PLUGIN_ROOTS = [path.join(DEVOS_ROOT, "plugins", "devos")].filter((p) => fs.existsSync(p));
|
|
49
|
+
|
|
50
|
+
const SKILL_DIRS = PLUGIN_ROOTS.flatMap((root) => {
|
|
51
|
+
const dir = path.join(root, "skills");
|
|
52
|
+
try {
|
|
53
|
+
return fs
|
|
54
|
+
.readdirSync(dir, { withFileTypes: true })
|
|
55
|
+
.filter((e) => e.isDirectory())
|
|
56
|
+
.map((e) => path.join(dir, e.name));
|
|
57
|
+
} catch {
|
|
58
|
+
return [];
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
const VAR_BASES = {
|
|
63
|
+
CLAUDE_PLUGIN_ROOT: PLUGIN_ROOTS,
|
|
64
|
+
CLAUDE_SKILL_DIR: SKILL_DIRS,
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
// The field each built-in tool carries a path-shaped argument on. A skill puts
|
|
68
|
+
// a variable in a `bash` command or a file path, and the model reaches for the
|
|
69
|
+
// narrower tool whenever it can, so every one of them gets the same rewrite.
|
|
70
|
+
const VAR_FIELD = {
|
|
71
|
+
bash: "command",
|
|
72
|
+
powershell: "command",
|
|
73
|
+
read: "path",
|
|
74
|
+
edit: "path",
|
|
75
|
+
write: "path",
|
|
76
|
+
grep: "path",
|
|
77
|
+
find: "path",
|
|
78
|
+
ls: "path",
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
const DEVOS_SKILL_NAMES = new Set(SKILL_DIRS.map((d) => path.basename(d)));
|
|
82
|
+
|
|
83
|
+
// A tool that wraps a DevOS skill in a command file says "read and follow
|
|
84
|
+
// this now" there. Pi expands
|
|
85
|
+
// `/skill:<name>` itself, into a bare `<skill>…</skill>` block with no
|
|
86
|
+
// instruction attached, so the model reads an injected document and answers
|
|
87
|
+
// "what would you like to work on?" instead of running step 1. Verified
|
|
88
|
+
// against pi 0.85.1: `input` fires before the expansion and anything after
|
|
89
|
+
// the command name is appended below the block, so the wrapper rides in as
|
|
90
|
+
// the skill's arguments.
|
|
91
|
+
const RUN_NOW =
|
|
92
|
+
"The skill above was injected because you were invoked as a DevOS command. It is this " +
|
|
93
|
+
"command's instruction set: follow it as written, in this conversation, starting at its " +
|
|
94
|
+
"first step, before any other action. The repository and the " +
|
|
95
|
+
"text under **Input** (absent when the command takes none) are the whole input; asking what " +
|
|
96
|
+
"to work on instead of starting is the one failure this wrapper exists to prevent. A literal " +
|
|
97
|
+
"`$ARGUMENTS` in the skill is that same **Input**: read it there, never ask for it again.\n\n" +
|
|
98
|
+
"Read each file the skill sends you to whole, with the read tool. A `sed -n` or `head` slice " +
|
|
99
|
+
"drops the gate a reference states at its end. The phases and gates are the work, not ceremony " +
|
|
100
|
+
"to trim for a task that looks simple. Once you write a spec, project edits stay blocked until the user approves its plan.\n\n" +
|
|
101
|
+
"Four names reach this harness differently, and taking the skill literally on any of them " +
|
|
102
|
+
"is a stall:\n" +
|
|
103
|
+
"- A DevOS command written `/devos:<name>` is `/skill:<name>` here. Use that spelling when " +
|
|
104
|
+
"you suggest one to the user; where the skill tells you to run one yourself, read " +
|
|
105
|
+
"`../<name>/SKILL.md` relative to this skill's own directory and follow it in full, since " +
|
|
106
|
+
"running that step from memory is how its gates get skipped.\n" +
|
|
107
|
+
"- `${CLAUDE_SKILL_DIR}` and `${CLAUDE_PLUGIN_ROOT}` are rewritten inside a bash command and " +
|
|
108
|
+
"stay literal in prose: keep them in the command, do not guess a path.\n" +
|
|
109
|
+
"- A dispatch to a fresh context is the `subagent` tool here (agent, task, optional cwd). " +
|
|
110
|
+
"If no such tool is among yours, run that step in this conversation and carry the marker the " +
|
|
111
|
+
"skill gives for it, rather than skipping the step.\n" +
|
|
112
|
+
"- A question asked through `AskUserQuestion` is the `ask_user` tool here. If `ask_user` is not " +
|
|
113
|
+
"among your tools, ask the same question in plain text and end the turn.";
|
|
114
|
+
|
|
115
|
+
/** Text for a `/skill:<devos-skill>` invocation, with the run-now wrapper
|
|
116
|
+
* appended as the skill's arguments. Null for anything else. */
|
|
117
|
+
export function wrapSkillCommand(text) {
|
|
118
|
+
if (!text.startsWith("/skill:")) return null;
|
|
119
|
+
const space = text.indexOf(" ");
|
|
120
|
+
const name = space === -1 ? text.slice(7) : text.slice(7, space);
|
|
121
|
+
if (!DEVOS_SKILL_NAMES.has(name)) return null;
|
|
122
|
+
const args = space === -1 ? "" : text.slice(space + 1).trim();
|
|
123
|
+
const input = args ? `**Input:** ${args}\n\n` : "";
|
|
124
|
+
return `/skill:${name} ${input}${RUN_NOW}`;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// Single-plugin references that never reach the rewriter (a subshell, an env
|
|
128
|
+
// lookup) still expand to something real.
|
|
129
|
+
if (PLUGIN_ROOTS.length > 0) process.env.CLAUDE_PLUGIN_ROOT = PLUGIN_ROOTS[0];
|
|
130
|
+
|
|
131
|
+
const VAR_RE =
|
|
132
|
+
/\$\{(CLAUDE_PLUGIN_ROOT|CLAUDE_SKILL_DIR)\}([\w./-]*)|\$(CLAUDE_PLUGIN_ROOT|CLAUDE_SKILL_DIR)([\w./-]*)/g;
|
|
133
|
+
|
|
134
|
+
/** Rewrite `${VAR}/rel` and `$VAR/rel` to the first candidate base where
|
|
135
|
+
* `base/rel` exists. No candidate matches -> first base, so the failure is a
|
|
136
|
+
* missing file with a real path in it, not an unexpanded variable. */
|
|
137
|
+
export function resolveClaudeVars(text) {
|
|
138
|
+
return text.replace(VAR_RE, (match, braced, bracedRel, bare, bareRel) => {
|
|
139
|
+
const name = braced || bare;
|
|
140
|
+
const rel = (braced ? bracedRel : bareRel) || "";
|
|
141
|
+
const bases = VAR_BASES[name] || [];
|
|
142
|
+
if (bases.length === 0) return match;
|
|
143
|
+
const hit = rel ? bases.find((b) => fs.existsSync(path.join(b, rel))) : null;
|
|
144
|
+
return (hit || bases[0]) + rel;
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/** Repo-state proxy for the stall counter: porcelain status plus HEAD.
|
|
149
|
+
* A constant string on a non-repo cwd is fine: stalled then means "nothing
|
|
150
|
+
* observable changed", which is exactly the question being asked. */
|
|
151
|
+
function repoState(cwd) {
|
|
152
|
+
try {
|
|
153
|
+
const status = spawnSync("git", ["-C", cwd || ".", "status", "--porcelain"], { encoding: "utf8" });
|
|
154
|
+
const head = spawnSync("git", ["-C", cwd || ".", "log", "--oneline", "-1"], { encoding: "utf8" });
|
|
155
|
+
return `${status.stdout || ""}|${head.stdout || ""}`;
|
|
156
|
+
} catch {
|
|
157
|
+
return "";
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/** Session-entry type backing the correction budget (see session_start). */
|
|
162
|
+
const CORRECTION_ENTRY = "devos-gate-correction";
|
|
163
|
+
|
|
164
|
+
/** Run a gate script. Returns {code, stderr}. Never throws: a gate that
|
|
165
|
+
* cannot run must allow (fail open). */
|
|
166
|
+
function runGate(script, args) {
|
|
167
|
+
try {
|
|
168
|
+
const r = spawnSync("bash", [path.join(GATES, script), ...args], {
|
|
169
|
+
encoding: "utf8",
|
|
170
|
+
});
|
|
171
|
+
if (r.error) return { code: 0, stderr: "" };
|
|
172
|
+
return { code: r.status ?? 0, stderr: (r.stderr || "").trim() };
|
|
173
|
+
} catch {
|
|
174
|
+
return { code: 0, stderr: "" };
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/** Concatenated text of an assistant message's content parts. */
|
|
179
|
+
function textOf(message) {
|
|
180
|
+
const content = message?.content;
|
|
181
|
+
if (!Array.isArray(content)) return content ?? "";
|
|
182
|
+
return content
|
|
183
|
+
.filter((c) => c?.type === "text" && c.text)
|
|
184
|
+
.map((c) => c.text)
|
|
185
|
+
.join("\n");
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// The plan gate. Prose rules hold for a model that reads all of them and
|
|
189
|
+
// weighs them as written. A weaker model reads part of plan.md, decides the
|
|
190
|
+
// approval step is ceremony, and edits code on the original ask. So the
|
|
191
|
+
// harness holds the phase: the spec folder this session opened decides what
|
|
192
|
+
// may change, derived from its files on every call.
|
|
193
|
+
const ACTIVE_SPEC_ENTRY = "devos-active-spec";
|
|
194
|
+
const IMPLEMENT_DIR = path.join(DEVOS_ROOT, "plugins/devos/skills/implement");
|
|
195
|
+
const SPEC_FILE_RE = /^(.*\/devos\/specs\/(?!archive\/)[^/]+)\/spec\.md$/;
|
|
196
|
+
const OPS_EVENT_RE = /ops-log\.sh\s+("[^"]+"|\S+)\s+(started|plan-approved|implemented|verified|closed)(?:\s|"|'|$)/;
|
|
197
|
+
const BASH_MUTATION_RE =
|
|
198
|
+
/\bsed\b[^|;&]*\s-(?:[a-zA-Z]*i\b|-in-place)|\bperl\b[^|;&]*\s-[a-zA-Z]*i|\bgit\s+(?:apply|commit|am)\b/;
|
|
199
|
+
const ROUTE_CMD_RE = /route\.sh\s+"?([FSMLRBCH])\b/;
|
|
200
|
+
const ASK_TOOLS = new Set(["ask_user", "AskUserQuestion"]);
|
|
201
|
+
|
|
202
|
+
const PHASES = {
|
|
203
|
+
spike: {
|
|
204
|
+
blocksCode: false,
|
|
205
|
+
next: "A spike is finished when findings.md holds the recommendation and the gaps. Build the recommended option next.",
|
|
206
|
+
},
|
|
207
|
+
"plan-missing": {
|
|
208
|
+
blocksCode: true,
|
|
209
|
+
next:
|
|
210
|
+
`Phase A. Read ${IMPLEMENT_DIR}/SKILL.md and ${IMPLEMENT_DIR}/references/plan.md whole, ` +
|
|
211
|
+
"write spec.md in the spec folder, present the plan, and end your turn for the user's yes.",
|
|
212
|
+
},
|
|
213
|
+
"awaiting-approval": {
|
|
214
|
+
blocksCode: true,
|
|
215
|
+
next:
|
|
216
|
+
"Phase A, plan written, not approved. Present the plan in a few plain lines and end your turn. " +
|
|
217
|
+
"After the user's unambiguous yes, log `ops-log.sh SPEC_DIR plan-approved`.",
|
|
218
|
+
},
|
|
219
|
+
"verify-pending": {
|
|
220
|
+
blocksCode: false,
|
|
221
|
+
next:
|
|
222
|
+
`Phase B, then C. Build the approved plan, then read ${IMPLEMENT_DIR}/references/verify-close.md ` +
|
|
223
|
+
"and write verifications/verification.md before any done claim.",
|
|
224
|
+
},
|
|
225
|
+
"close-pending": {
|
|
226
|
+
blocksCode: false,
|
|
227
|
+
next: `Phase C. Verified. Read ${IMPLEMENT_DIR}/references/dod.md, give the verdict, archive the folder.`,
|
|
228
|
+
},
|
|
229
|
+
missing: {
|
|
230
|
+
blocksCode: true,
|
|
231
|
+
next: "The spec folder is gone without being archived. Ask the user whether to drop it.",
|
|
232
|
+
},
|
|
233
|
+
archived: { blocksCode: false, next: "" },
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
// The route gate, one step earlier. A model that sized the task as M in its
|
|
237
|
+
// own words can still answer the next "go" by editing code, because no spec
|
|
238
|
+
// folder exists yet for the plan gate to hold. So /skill:build commits the
|
|
239
|
+
// size through devos_route before any project file changes, and a route that
|
|
240
|
+
// owes a spec keeps code blocked until the spec folder exists.
|
|
241
|
+
const ROUTE_ENTRY = "devos-route";
|
|
242
|
+
const BUILD_REFS = path.join(DEVOS_ROOT, "plugins/devos/skills/build/references");
|
|
243
|
+
const SPEC_ROUTE_NEXT =
|
|
244
|
+
"Create devos/specs/YYYY-MM-DD-<name>/spec.md now, as " +
|
|
245
|
+
`${BUILD_REFS}/routes.md says for this size. Project files stay blocked until its plan is approved.`;
|
|
246
|
+
const FRAME_NEXT =
|
|
247
|
+
`Read ${path.join(DEVOS_ROOT, "plugins/devos/skills/frame")}/SKILL.md whole. A frame changes no production code: ` +
|
|
248
|
+
"it ends with devos/frames/<name>/frame.md and one re-route per ticket.";
|
|
249
|
+
const ROUTES = {
|
|
250
|
+
F: { blocksCode: true, next: FRAME_NEXT },
|
|
251
|
+
S: { blocksCode: false, next: "Say the change in one plain sentence, make it, run the checks that cover it." },
|
|
252
|
+
M: { blocksCode: true, next: SPEC_ROUTE_NEXT },
|
|
253
|
+
L: { blocksCode: true, next: SPEC_ROUTE_NEXT },
|
|
254
|
+
C: { blocksCode: true, next: `Read ${BUILD_REFS}/refactor.md whole. ${SPEC_ROUTE_NEXT}` },
|
|
255
|
+
R: { blocksCode: true, next: `Read ${BUILD_REFS}/spike.md whole. A spike changes no production code.` },
|
|
256
|
+
B: { blocksCode: false, next: `Read ${BUILD_REFS}/defect.md whole and reproduce before any fix.` },
|
|
257
|
+
H: { blocksCode: false, next: `Read ${BUILD_REFS}/hard.md whole and start the ledger.` },
|
|
258
|
+
};
|
|
259
|
+
const UNROUTED_NEXT = "Size the task from the code, then call devos_route with the size before changing any file.";
|
|
260
|
+
|
|
261
|
+
/** Phase of a spec folder, from its files alone. */
|
|
262
|
+
export function specPhase(specDir) {
|
|
263
|
+
const has = (rel) => fs.existsSync(path.join(specDir, rel));
|
|
264
|
+
if (!fs.existsSync(specDir)) {
|
|
265
|
+
const archived = path.join(path.dirname(specDir), "archive", path.basename(specDir));
|
|
266
|
+
return fs.existsSync(archived) ? "archived" : "missing";
|
|
267
|
+
}
|
|
268
|
+
// A spike folder holds findings.md only, so it is a finished spike, not a spec without a plan.
|
|
269
|
+
if (!has("spec.md") && has("findings.md")) return "spike";
|
|
270
|
+
if (!hasPlan(specDir)) return "plan-missing";
|
|
271
|
+
const ops = has("ops.jsonl") ? fs.readFileSync(path.join(specDir, "ops.jsonl"), "utf8") : "";
|
|
272
|
+
if (!ops.includes('"event":"plan-approved"')) return "awaiting-approval";
|
|
273
|
+
return has("verifications/verification.md") ? "close-pending" : "verify-pending";
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
function hasPlan(specDir) {
|
|
277
|
+
const plan = path.join(specDir, "spec.md");
|
|
278
|
+
if (!fs.existsSync(plan)) return false;
|
|
279
|
+
return /^## Implementation Plan/m.test(fs.readFileSync(plan, "utf8"));
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
function projectRootOf(specDir) {
|
|
283
|
+
return path.dirname(path.dirname(path.dirname(specDir)));
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
function isInside(file, dir) {
|
|
287
|
+
const rel = path.relative(dir, file);
|
|
288
|
+
return rel !== "" && !rel.startsWith("..") && !path.isAbsolute(rel);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
function routeGateReason(route, what) {
|
|
292
|
+
const next = route === "unrouted" ? UNROUTED_NEXT : `Route ${route}. ${ROUTES[route].next}`;
|
|
293
|
+
return `DevOS route gate: ${what} is blocked. ${next} Only the user lifts this gate, by running /devos-release.`;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
function planGateReason(specDir, phase, what) {
|
|
297
|
+
return (
|
|
298
|
+
`DevOS plan gate: ${what} is blocked. ${path.relative(projectRootOf(specDir), specDir)} has no approved plan. ` +
|
|
299
|
+
`${PHASES[phase].next.replace("SPEC_DIR", specDir)} ` +
|
|
300
|
+
"Only the user lifts this gate: by approving the plan, or by running /devos-release."
|
|
301
|
+
);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
function withTempPair(oldContent, newContent, fn) {
|
|
305
|
+
const stamp = `${process.pid}-${Math.random().toString(36).slice(2)}`;
|
|
306
|
+
const oldTmp = path.join(os.tmpdir(), `devos-old-${stamp}`);
|
|
307
|
+
const newTmp = path.join(os.tmpdir(), `devos-new-${stamp}`);
|
|
308
|
+
try {
|
|
309
|
+
fs.writeFileSync(oldTmp, oldContent);
|
|
310
|
+
fs.writeFileSync(newTmp, newContent);
|
|
311
|
+
return fn(oldTmp, newTmp);
|
|
312
|
+
} finally {
|
|
313
|
+
fs.rmSync(oldTmp, { force: true });
|
|
314
|
+
fs.rmSync(newTmp, { force: true });
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
export default function devosExtension(pi) {
|
|
319
|
+
// Each correction triggers a new turn, which fires turn_end again. Without
|
|
320
|
+
// a cap, a model that keeps repeating a malformed DONE claim would loop
|
|
321
|
+
// forever, spending real turns each time. Progress-aware budget: a correction
|
|
322
|
+
// resets its stall
|
|
323
|
+
// counter whenever the repo state changed since the previous one, proxied
|
|
324
|
+
// by `git status --porcelain` plus HEAD (fixes commit or dirty files;
|
|
325
|
+
// verification reports land under devos/specs/, so they show too). Stalled
|
|
326
|
+
// = corrections with zero state change between them: MAX_STALLED of those
|
|
327
|
+
// in a row, or MAX_TOTAL overall, send the gate quiet and the human reads
|
|
328
|
+
// the corrections already in the session. The proxy cannot see edits inside
|
|
329
|
+
// an already-dirty file; MAX_TOTAL bounds that ceiling.
|
|
330
|
+
const correctedTurns = new Set();
|
|
331
|
+
const MAX_STALLED = 2;
|
|
332
|
+
const MAX_TOTAL = 6;
|
|
333
|
+
let corrections = 0;
|
|
334
|
+
let stalled = 0;
|
|
335
|
+
let lastStateHash = "";
|
|
336
|
+
let activeSpec = null;
|
|
337
|
+
let route = null;
|
|
338
|
+
let lastHumanAt = 0;
|
|
339
|
+
|
|
340
|
+
// The budget survives /tree navigation and session reload: every correction
|
|
341
|
+
// is appended as a custom session entry and replayed on startup, so a
|
|
342
|
+
// reloaded session cannot re-spend it. Entries carry the running counters;
|
|
343
|
+
// pre-0.10.14 entries carry only turnIndex and replay as +1 each.
|
|
344
|
+
pi.on("session_start", async (_event, ctx) => {
|
|
345
|
+
for (const entry of ctx?.sessionManager?.getEntries() ?? []) {
|
|
346
|
+
if (entry.type === "custom" && entry.customType === ACTIVE_SPEC_ENTRY) {
|
|
347
|
+
activeSpec = entry.data?.specDir ?? null;
|
|
348
|
+
}
|
|
349
|
+
if (entry.type === "custom" && entry.customType === ROUTE_ENTRY) {
|
|
350
|
+
route = entry.data?.route ?? null;
|
|
351
|
+
}
|
|
352
|
+
if (entry.type === "custom" && entry.customType === CORRECTION_ENTRY) {
|
|
353
|
+
if (Number.isFinite(entry.data?.corrections)) {
|
|
354
|
+
corrections = Math.max(corrections, entry.data.corrections);
|
|
355
|
+
stalled = Math.max(stalled, entry.data.stalled ?? 0);
|
|
356
|
+
lastStateHash = entry.data.stateHash ?? lastStateHash;
|
|
357
|
+
} else {
|
|
358
|
+
corrections += 1;
|
|
359
|
+
}
|
|
360
|
+
if (Number.isFinite(entry.data?.turnIndex)) correctedTurns.add(entry.data.turnIndex);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
});
|
|
364
|
+
|
|
365
|
+
function setActiveSpec(specDir) {
|
|
366
|
+
if (specDir && (route === "unrouted" || route === "M" || route === "L" || route === "C")) setRoute(null);
|
|
367
|
+
if (specDir === activeSpec) return;
|
|
368
|
+
activeSpec = specDir;
|
|
369
|
+
pi.appendEntry(ACTIVE_SPEC_ENTRY, { specDir });
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
function setRoute(next) {
|
|
373
|
+
if (next === route) return;
|
|
374
|
+
route = next;
|
|
375
|
+
pi.appendEntry(ROUTE_ENTRY, { route });
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
pi.registerTool({
|
|
379
|
+
name: "devos_route",
|
|
380
|
+
label: "DevOS route",
|
|
381
|
+
description:
|
|
382
|
+
"Commit the size you picked for a /skill:build task, before changing any project file. " +
|
|
383
|
+
"F first when the ask does not say what to change: a bare ticket title, a wish, an epic. " +
|
|
384
|
+
"S only for zero blast radius, sized from the code: a user calling it simple does not make it S. " +
|
|
385
|
+
"M, L and C must write a spec and get the plan approved before code changes. " +
|
|
386
|
+
"Once a larger size is set, only the user can drop back to S.",
|
|
387
|
+
parameters: {
|
|
388
|
+
type: "object",
|
|
389
|
+
properties: {
|
|
390
|
+
size: { type: "string", enum: Object.keys(ROUTES), description: "The route from build/SKILL.md" },
|
|
391
|
+
why: { type: "string", description: "One sentence: the evidence from the code that decided the size" },
|
|
392
|
+
},
|
|
393
|
+
required: ["size", "why"],
|
|
394
|
+
},
|
|
395
|
+
async execute(_id, params) {
|
|
396
|
+
return { content: [{ type: "text", text: commitRoute(params.size).text }], details: { route } };
|
|
397
|
+
},
|
|
398
|
+
});
|
|
399
|
+
|
|
400
|
+
function commitRoute(size) {
|
|
401
|
+
if (!ROUTES[size]) return { refused: true, text: `Unknown size ${size}. ${UNROUTED_NEXT}` };
|
|
402
|
+
if (size === "S" && route && route !== "unrouted" && route !== "F" && route !== "S") {
|
|
403
|
+
return {
|
|
404
|
+
refused: true,
|
|
405
|
+
text:
|
|
406
|
+
`Refused: this task is already routed ${route}, and a route never shrinks on the model's word. ` +
|
|
407
|
+
`${ROUTES[route].next} Ask the user if you think it is S.`,
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
setRoute(size);
|
|
411
|
+
return { refused: false, text: `Route ${size}. ${ROUTES[size].next}` };
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
pi.registerCommand("devos-release", {
|
|
415
|
+
description: "Drop the DevOS plan gate for this session's spec",
|
|
416
|
+
handler: async (_args, ctx) => {
|
|
417
|
+
const was = activeSpec ?? (route ? `route ${route}` : null);
|
|
418
|
+
setActiveSpec(null);
|
|
419
|
+
setRoute(null);
|
|
420
|
+
ctx?.ui?.notify?.(was ? `DevOS gate released for ${was}` : "No active DevOS gate", "info");
|
|
421
|
+
},
|
|
422
|
+
});
|
|
423
|
+
|
|
424
|
+
pi.on("before_agent_start", async (event) => {
|
|
425
|
+
const sections = event.systemPromptOptions?.sections;
|
|
426
|
+
if (!sections) return;
|
|
427
|
+
const phase = activeSpec ? specPhase(activeSpec) : "archived";
|
|
428
|
+
if (phase === "archived") {
|
|
429
|
+
if (route === "unrouted") sections["devos-state"] = `DevOS /skill:build in progress. ${UNROUTED_NEXT}`;
|
|
430
|
+
else if (route) sections["devos-state"] = `DevOS /skill:build route ${route}. ${ROUTES[route].next}`;
|
|
431
|
+
else delete sections["devos-state"];
|
|
432
|
+
return;
|
|
433
|
+
}
|
|
434
|
+
sections["devos-state"] =
|
|
435
|
+
`Active DevOS spec: ${activeSpec}\nPhase: ${phase}\nNext: ${PHASES[phase].next.replace("SPEC_DIR", activeSpec)}` +
|
|
436
|
+
(PHASES[phase].blocksCode ? "\nFiles outside devos/ stay unchanged until the plan is approved." : "");
|
|
437
|
+
});
|
|
438
|
+
|
|
439
|
+
pi.on("tool_result", async (event) => {
|
|
440
|
+
if (ASK_TOOLS.has(event.toolName) && !event.isError) lastHumanAt = Date.now();
|
|
441
|
+
});
|
|
442
|
+
|
|
443
|
+
pi.on("input", async (event) => {
|
|
444
|
+
if (event.source === "extension") return { action: "continue" };
|
|
445
|
+
lastHumanAt = Date.now();
|
|
446
|
+
if (/^\/skill:build(?:\s|$)/.test(event.text)) setRoute("unrouted");
|
|
447
|
+
const text = wrapSkillCommand(event.text);
|
|
448
|
+
return text ? { action: "transform", text } : { action: "continue" };
|
|
449
|
+
});
|
|
450
|
+
|
|
451
|
+
// One `tool_call` registration, two jobs, in order: expand the Claude Code
|
|
452
|
+
// path variables on whichever field that tool feeds them to, then run the
|
|
453
|
+
// test-integrity gate on `edit`/`write`.
|
|
454
|
+
pi.on("tool_call", async (event, ctx) => {
|
|
455
|
+
const input = event.input || {};
|
|
456
|
+
|
|
457
|
+
const varField = VAR_FIELD[event.toolName];
|
|
458
|
+
if (varField && input[varField]) input[varField] = resolveClaudeVars(input[varField]);
|
|
459
|
+
|
|
460
|
+
const target =
|
|
461
|
+
(event.toolName === "edit" || event.toolName === "write") && input.path
|
|
462
|
+
? path.resolve(ctx?.cwd || ".", input.path)
|
|
463
|
+
: null;
|
|
464
|
+
const specFile = target?.match(SPEC_FILE_RE);
|
|
465
|
+
if (specFile) setActiveSpec(specFile[1]);
|
|
466
|
+
|
|
467
|
+
const routeCmd = event.toolName === "bash" ? input.command?.match(ROUTE_CMD_RE) : null;
|
|
468
|
+
if (routeCmd) {
|
|
469
|
+
const committed = commitRoute(routeCmd[1]);
|
|
470
|
+
if (committed.refused) return { block: true, reason: `DevOS route gate: ${committed.text}` };
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
const opsEvent = event.toolName === "bash" ? input.command?.match(OPS_EVENT_RE) : null;
|
|
474
|
+
const opsSpec = opsEvent ? path.resolve(ctx?.cwd || ".", opsEvent[1].replace(/^"|"$/g, "")) : null;
|
|
475
|
+
if (opsEvent?.[2] === "started") setActiveSpec(opsSpec);
|
|
476
|
+
if (opsEvent?.[2] === "plan-approved") {
|
|
477
|
+
if (!hasPlan(opsSpec)) {
|
|
478
|
+
return { block: true, reason: planGateReason(opsSpec, "plan-missing", "Logging plan-approved") };
|
|
479
|
+
}
|
|
480
|
+
const planAt = fs.statSync(path.join(opsSpec, "spec.md")).mtimeMs;
|
|
481
|
+
if (ctx?.hasUI && lastHumanAt <= planAt) {
|
|
482
|
+
return {
|
|
483
|
+
block: true,
|
|
484
|
+
reason:
|
|
485
|
+
"DevOS plan gate: the user has not replied since spec.md was last written, so nobody approved " +
|
|
486
|
+
"this plan. Present it and end your turn. The original request is not the approval.",
|
|
487
|
+
};
|
|
488
|
+
}
|
|
489
|
+
setActiveSpec(opsSpec);
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
if (route && (route === "unrouted" || ROUTES[route].blocksCode)) {
|
|
493
|
+
const root = path.resolve(ctx?.cwd || ".");
|
|
494
|
+
if (target && isInside(target, root) && !isInside(target, path.join(root, "devos"))) {
|
|
495
|
+
return { block: true, reason: routeGateReason(route, `Changing ${path.relative(root, target)}`) };
|
|
496
|
+
}
|
|
497
|
+
if (event.toolName === "bash" && BASH_MUTATION_RE.test(input.command || "")) {
|
|
498
|
+
return { block: true, reason: routeGateReason(route, "An in-place edit or commit from bash") };
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
const phase = activeSpec ? specPhase(activeSpec) : "archived";
|
|
503
|
+
if (PHASES[phase].blocksCode) {
|
|
504
|
+
const root = projectRootOf(activeSpec);
|
|
505
|
+
if (target && isInside(target, root) && !isInside(target, path.join(root, "devos"))) {
|
|
506
|
+
return { block: true, reason: planGateReason(activeSpec, phase, `Changing ${path.relative(root, target)}`) };
|
|
507
|
+
}
|
|
508
|
+
if (event.toolName === "bash" && BASH_MUTATION_RE.test(input.command || "")) {
|
|
509
|
+
return { block: true, reason: planGateReason(activeSpec, phase, "An in-place edit or commit from bash") };
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
if (event.toolName === "bash" && input.command) {
|
|
514
|
+
// Phase-transition chokepoints carry DoD as a HARD BLOCK.
|
|
515
|
+
// turn_end cannot veto (header), but closing or advancing a spec routes
|
|
516
|
+
// through these bash invocations, so denying them denies the false
|
|
517
|
+
// done. Filesystem decision only: a spec with a plan may not log
|
|
518
|
+
// `closed` without its verification report. Unparseable commands allow,
|
|
519
|
+
// same fail-open posture as every other gate here.
|
|
520
|
+
const transition = input.command.match(
|
|
521
|
+
/ops-log\.sh\s+("[^"]+"|\S+)\s+(closed|verified|implemented)(?:\s|"|'|$)/,
|
|
522
|
+
);
|
|
523
|
+
if (transition) {
|
|
524
|
+
const specArg = transition[1].replace(/^"|"$/g, "");
|
|
525
|
+
const phase = transition[2];
|
|
526
|
+
const specDir = path.isAbsolute(specArg)
|
|
527
|
+
? specArg
|
|
528
|
+
: path.resolve(ctx?.cwd || ".", specArg);
|
|
529
|
+
if (
|
|
530
|
+
phase === "closed" &&
|
|
531
|
+
fs.existsSync(path.join(specDir, "spec.md")) &&
|
|
532
|
+
!fs.existsSync(path.join(specDir, "verifications", "verification.md"))
|
|
533
|
+
) {
|
|
534
|
+
return {
|
|
535
|
+
block: true,
|
|
536
|
+
reason: `DoD gate: ${specArg} has no verifications/verification.md - run Phase C before closing.`,
|
|
537
|
+
};
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
if (event.toolName !== "edit" && event.toolName !== "write") return;
|
|
543
|
+
|
|
544
|
+
const file = input.path;
|
|
545
|
+
if (!file) return; // unparseable -> allow, never block
|
|
546
|
+
|
|
547
|
+
// `edit` passes targeted oldText/newText snippet pairs: compare snippet
|
|
548
|
+
// against snippet. Comparing a snippet to the whole old file would flag
|
|
549
|
+
// every assertion the edit does not happen to repeat as "deleted".
|
|
550
|
+
// `write` passes the whole new file: compare against the old file.
|
|
551
|
+
let oldContent, newContent;
|
|
552
|
+
if (event.toolName === "edit") {
|
|
553
|
+
const edits = Array.isArray(input.edits) ? input.edits : [];
|
|
554
|
+
oldContent = edits.map((e) => e?.oldText ?? "").join("\n");
|
|
555
|
+
newContent = edits.map((e) => e?.newText ?? "").join("\n");
|
|
556
|
+
} else {
|
|
557
|
+
oldContent = fs.existsSync(file) ? fs.readFileSync(file, "utf8") : "";
|
|
558
|
+
newContent = input.content ?? "";
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
const result = withTempPair(oldContent, newContent, (oldTmp, newTmp) => {
|
|
562
|
+
const gateArgs = ["--file", file, "--old", oldTmp, "--new", newTmp];
|
|
563
|
+
if (event.toolName === "write") gateArgs.push("--write");
|
|
564
|
+
return runGate("test-integrity-rubric.sh", gateArgs);
|
|
565
|
+
});
|
|
566
|
+
|
|
567
|
+
if (result.code === 2) {
|
|
568
|
+
return {
|
|
569
|
+
block: true,
|
|
570
|
+
reason: result.stderr || "DevOS test-integrity gate: edit denied.",
|
|
571
|
+
};
|
|
572
|
+
}
|
|
573
|
+
});
|
|
574
|
+
|
|
575
|
+
pi.on("turn_end", async (event, ctx) => {
|
|
576
|
+
if (corrections >= MAX_TOTAL) return;
|
|
577
|
+
if (correctedTurns.has(event.turnIndex)) return;
|
|
578
|
+
|
|
579
|
+
const text = textOf(event.message);
|
|
580
|
+
if (!text) return;
|
|
581
|
+
|
|
582
|
+
const stamp = `${process.pid}-${event.turnIndex}`;
|
|
583
|
+
const tmp = path.join(os.tmpdir(), `devos-transcript-${stamp}`);
|
|
584
|
+
let reason = "";
|
|
585
|
+
try {
|
|
586
|
+
fs.writeFileSync(tmp, text);
|
|
587
|
+
const dod = runGate("check-dod-core.sh", [tmp]);
|
|
588
|
+
if (dod.code === 2) reason = `DoD gate: ${dod.stderr}`;
|
|
589
|
+
} finally {
|
|
590
|
+
fs.rmSync(tmp, { force: true });
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
if (reason) {
|
|
594
|
+
const stateHash = repoState(ctx?.cwd);
|
|
595
|
+
if (!lastStateHash || stateHash !== lastStateHash) stalled = 0;
|
|
596
|
+
else stalled += 1;
|
|
597
|
+
lastStateHash = stateHash;
|
|
598
|
+
if (stalled > MAX_STALLED || corrections >= MAX_TOTAL) return;
|
|
599
|
+
correctedTurns.add(event.turnIndex);
|
|
600
|
+
corrections += 1;
|
|
601
|
+
pi.appendEntry(CORRECTION_ENTRY, { turnIndex: event.turnIndex, corrections, stalled, stateHash });
|
|
602
|
+
pi.sendUserMessage(`DevOS ${reason}`, { deliverAs: "followUp" });
|
|
603
|
+
}
|
|
604
|
+
});
|
|
605
|
+
}
|