okstra 0.183.2 → 0.185.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.
Files changed (54) hide show
  1. package/README.md +2 -2
  2. package/dist/cli-registry.mjs +9 -0
  3. package/dist/cli-registry.mjs.map +1 -1
  4. package/dist/commands/chat/chat.d.mts +1 -0
  5. package/dist/commands/chat/chat.mjs +385 -0
  6. package/dist/commands/chat/chat.mjs.map +1 -0
  7. package/dist/lib/skill-catalog.mjs +1 -0
  8. package/dist/lib/skill-catalog.mjs.map +1 -1
  9. package/docs/architecture.md +10 -8
  10. package/docs/cli.md +9 -5
  11. package/docs/for-ai/README.md +4 -2
  12. package/docs/for-ai/skills/okstra-chat.md +28 -0
  13. package/docs/for-ai/skills/okstra-inspect.md +1 -1
  14. package/docs/for-ai/skills/okstra-run.md +2 -2
  15. package/docs/for-ai/skills/okstra-user-response.md +10 -8
  16. package/docs/project-structure-overview.md +6 -5
  17. package/docs/task-process/README.md +2 -2
  18. package/docs/task-process/common-flow.md +2 -3
  19. package/docs/task-process/error-analysis.md +3 -4
  20. package/docs/task-process/final-verification.md +2 -3
  21. package/docs/task-process/implementation-planning.md +3 -4
  22. package/docs/task-process/implementation.md +2 -3
  23. package/docs/task-process/release-handoff.md +3 -4
  24. package/docs/task-process/requirements-discovery.md +3 -4
  25. package/package.json +1 -1
  26. package/runtime/BUILD.json +2 -2
  27. package/runtime/prompts/launch.template.md +8 -7
  28. package/runtime/prompts/lead/okstra-lead-contract.md +7 -6
  29. package/runtime/prompts/lead/plan-body-verification.md +27 -19
  30. package/runtime/prompts/lead/report-writer.md +4 -4
  31. package/runtime/prompts/profiles/_clarification-recommendation.md +2 -2
  32. package/runtime/prompts/profiles/_implementation-executor.md +1 -0
  33. package/runtime/prompts/profiles/_implementation-verifier.md +1 -1
  34. package/runtime/prompts/profiles/implementation-planning.md +11 -12
  35. package/runtime/prompts/wizard/prompts.ko.json +9 -10
  36. package/runtime/python/okstra_ctl/adapters/hosts/claude-code/relay.md +2 -2
  37. package/runtime/python/okstra_ctl/adapters/hosts/codex/relay.md +1 -1
  38. package/runtime/python/okstra_ctl/adapters/hosts/grok/relay.md +1 -1
  39. package/runtime/python/okstra_ctl/conformance.py +37 -1
  40. package/runtime/python/okstra_ctl/incremental_scope.py +84 -39
  41. package/runtime/python/okstra_ctl/next_phase.py +67 -4
  42. package/runtime/python/okstra_ctl/plan_items.py +410 -1
  43. package/runtime/python/okstra_ctl/plan_items_cli.py +346 -31
  44. package/runtime/python/okstra_ctl/render.py +4 -0
  45. package/runtime/python/okstra_ctl/user_response.py +147 -37
  46. package/runtime/python/okstra_ctl/wizard.py +52 -73
  47. package/runtime/schemas/final-report-v2.0.schema.json +12 -0
  48. package/runtime/schemas/final-report-v3.0.schema.json +12 -0
  49. package/runtime/skills/okstra-chat/SKILL.md +104 -0
  50. package/runtime/skills/okstra-inspect/facets/status.md +6 -5
  51. package/runtime/skills/okstra-run/SKILL.md +4 -4
  52. package/runtime/skills/okstra-user-response/SKILL.md +50 -16
  53. package/runtime/validators/validate-run.py +254 -81
  54. package/runtime/validators/validate_session_conformance.py +24 -5
package/README.md CHANGED
@@ -195,7 +195,7 @@ Use these slash commands inside a Claude Code session:
195
195
  | `/okstra-container-build` | Deploy a verified task's code as a local Docker Compose group and monitor per-container logs (subcommands: `up` / `status` / `logs` / `stop-watcher` / `down`) |
196
196
  | `/okstra-manager` | Coordinate cross-project okstra tasks through manager-owned plans, assignments, one-way project sync snapshots, status, and child launch context packets |
197
197
  | `/okstra-pr-gen` | Register PR body templates under `~/.okstra/template/pr/` and generate a PR description from a branch diff (subcommands: `template` / `branches` / `gen`). Global skill—needs a Git repo, not a registered okstra project |
198
- | `/okstra-user-response` | Answer a task's open clarification questions in-session and write the response sidecar. Each answer is dispositioned as `answer` or `reframe`; a `reframe` is carried into the next run as a re-scoped brief |
198
+ | `/okstra-user-response` | Answer a task's open clarification questions in-session and write the response sidecar. The skill reads cited context first, then asks in plain language with each option's outcome through the host's native selection UI. Each answer is dispositioned as `answer` or `reframe`; a `reframe` is carried into the next run as a re-scoped brief |
199
199
  | `/okstra-code-review` | Review what a diff changed—one okstra `implementation` stage, or any branch—against this project's coding-preflight rules, and write the result to a file. The orchestrator censuses the diff into an explicit worklist once, four parallel reviewers return a verdict for every cell, and a coverage audit re-dispatches any gap. Result files land under `.okstra/tasks/<task-group>/<task-id>/code-reviews/` (stage mode) or `.project-docs/code-reviews/<branch>/` (branch mode) |
200
200
  | `/okstra-setup` | Bootstrap a project as described in §3.2 |
201
201
 
@@ -240,7 +240,7 @@ Major workflow changes added to `main` after 0.8.0:
240
240
  - **Implementation direction selection before detailed planning** — `implementation-option-selection` is a read-only lifecycle phase between error analysis and planning. Comparison mode evaluates the merged raw candidates and displays at most three ranked directions. Every displayed direction has `coveragePercent == 100`, `scopePrecisionPercent == 100`, no unmapped commitment, and no contradicted requirement. The user confirms one direction in a separate `DIRECTION SELECTION` response before a new planning run starts with `--selected-direction`. `implementation-planning` then expands that one direction into files, stages, validation, and rollback, and the resulting plan still requires its own approval. A preselected direction is validated without generating alternatives. Existing approved plans without `planningContract: selected-direction` keep the legacy `--implementation-option` execution path.
241
241
  - **Multi-stage `implementation-planning` / `implementation`** — `implementation-planning` always produces a Stage Map and N stage sections. Each stage has no more than six steps, and stages with `depends-on (none)` can be implemented concurrently in separate `implementation` runs. Each `implementation` invocation runs a single stage, selected with `--stage <auto|N>`, and creates an evidence sidecar at `carry/stage-<N>.json` for automatic carry-in to the next stage. The `implementation-planning` run directory accumulates `consumers.jsonl` reverse links that record which run consumed each stage.
242
242
  - **AI-prepared design preparation (implementation-planning → implementation)** — `implementation-planning` detects which stages need design input (domain contract, DB/table schema, external interface, transaction/consistency, transformation mapping, lifecycle, rollout/observability, manual user test) and has the AI draft a concrete proposal first, instead of handing the user an empty design document. Each item is assessed as `ready`, `provisional`, `blocked`, or `not-applicable`; a simple task may declare `no-design-inputs`. Phase 7 materializes an Okstra-owned request under `design-prep-requests/`, and `okstra design-prep <list|show|write>` or the okstra-run wizard records the confirmed answer as an **append-only** revision under `design-prep-inputs/`—neither path ever edits the approved planning snapshot. Before creating its worktree, `implementation` resolves only the items its selected stage cites in `stageRefs`: safe `provisional` assumptions are injected into the executor prompt so work proceeds, while an unsafe open decision makes only that stage wait or replan. A markerless legacy plan continues with a `legacy-unassessed` warning. Storage authorities: [`docs/architecture/storage-model.md`](docs/architecture/storage-model.md). CLI: [`docs/cli.md#okstra-design-prep`](docs/cli.md#okstra-design-prep).
243
- - **Phase 6 plan-body verification (implementation-planning only)** — Immediately after the report-writer worker drafts the final report and before the user approval gate, the lead performs one post-verification round. A selected-direction plan starts with `P-Dir-1`; a legacy candidate plan retains `P-Opt-*`. Both branches add `P-Step-*`, `P-Dep-*`, `P-Val-*`, and `P-Rb-*` items and ask every analyzer worker for an `AGREE`, `DISAGREE(a-e)`, or `SUPPLEMENT` verdict. The aggregate result is `passed`, `passed-with-dissent`, `blocked-by-disagreement`, or `aborted-non-result`. The frontmatter `approved` field is always published as `false`; a blocking result keeps it false and becomes a row in `## 1. Clarification Items`. For fast iteration, opt out with `--no-plan-verification`. Contract details: the "Plan-body verification mode" section of [`prompts/lead/convergence.md`](prompts/lead/convergence.md) and [`docs/cli.md#--no-plan-verification`](docs/cli.md#--no-plan-verification).
243
+ - **Phase 6 plan-body verification (implementation-planning only)** — Immediately after the report-writer worker drafts the final report and before the user approval gate, the lead performs one post-verification round. A selected-direction plan starts with `P-Dir-1`; a legacy candidate plan retains `P-Opt-*`. Both branches add `P-Step-*`, `P-Dep-*`, `P-Val-*`, and `P-Rb-*` items and ask every analyzer worker for an `AGREE`, `DISAGREE(a-e)`, or `SUPPLEMENT` verdict. The aggregate result is `passed`, `passed-with-dissent`, `blocked-by-disagreement`, or `aborted-non-result`. The frontmatter `approved` field is always published as `false`; a blocking result keeps it false and becomes a row in `## 1. Clarification Items`. A one-stage `no-design-inputs` plan keeps extraction and one verification round but sets `gating=false`, so the self-fix loop and a sweep batch do not run. For fast iteration, skip the round entirely with `--no-plan-verification`. Contract details: the "Plan-body verification mode" section of [`prompts/lead/convergence.md`](prompts/lead/convergence.md) and [`docs/cli.md#--no-plan-verification`](docs/cli.md#--no-plan-verification).
244
244
  - **Brief as translation layer + Step 6.5 reporter batch confirmation** — `okstra-brief-gen` converts external input—an issue ticket, requirements document, or user message—verbatim and marks okstra-added content as labeled augmentation. Step 6.5 asks the user to confirm in one batch whether that conversion changed meaning and records the result in `Reporter Confirmations`. Every analysis profile requires this section before phase analysis begins; `validators/validate-brief.py` enforces the requirement.
245
245
  - **Artifact-home rule (`.okstra/`)** — `<project>/.okstra/` is the only project artifact root owned by okstra. Anything outside this root is not okstra memory and may be read only when explicitly cited in Source Material or Reporter Confirmations. Writing outside the root requires the same explicit requested path. Internal equivalents are `glossary.md` for terminology and `decisions/<NNNN>-<slug>.md` for decision records, evaluated during `implementation-planning`.
246
246
  - **Single-owner report inputs and separate human views** — New runs use report contract v3. The report writer authors narrative Markdown while approval, activity, execution, convergence, design-preparation, and plan-body state remain in separate single-owner artifacts. Phase 7 validates those inputs and atomically assembles `final-report-<task-type>-<seq>.data.json` against `schemas/final-report-v3.0.schema.json`, then derives a task-specific human HTML view. The full reading copy Markdown still uses `templates/reports/final-report-v2.template.md` and is rendered on demand with `okstra render-final-report`. Each of the eleven task types owns a dedicated template under `templates/reports/html/tasks/`. Historical `schemas/final-report-v2.0.schema.json` and schema v1 reports remain readable; new runs do not write them.
@@ -510,6 +510,15 @@ export const COMMAND_REGISTRY = [
510
510
  "~/.okstra/memory-book.",
511
511
  ],
512
512
  },
513
+ {
514
+ name: "chat",
515
+ module: "./commands/chat/chat.mjs",
516
+ export: "run",
517
+ category: "introspection",
518
+ summary: [
519
+ "Create and join global chat rooms under ~/.okstra/chat.",
520
+ ],
521
+ },
513
522
  {
514
523
  name: "pr",
515
524
  module: "./commands/pr/pr.mjs",
@@ -1 +1 @@
1
- {"version":3,"file":"cli-registry.mjs","sourceRoot":"","s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C,IAAI,CAAC,IAAI,CAAC,CAAC;AAC7C,CAAC;AAED,SAAS,UAAU,CAAC,QAAuC;IACzD,OAAO,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC;SAC3D,GAAG,CAAC,SAAS,CAAC;SACd,IAAI,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC;AAED,MAAM,CAAC,MAAM,KAAK,GAChB,QAAQ;IACR,qBAAqB;IACrB,UAAU,CAAC,OAAO,CAAC;IACnB,2FAA2F;IAC3F,UAAU,CAAC,eAAe,CAAC;IAC3B,uBAAuB;IACvB,cAAc;IACd,MAAM,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function run(args: readonly string[]): Promise<number>;
@@ -0,0 +1,385 @@
1
+ import { promises as fs } from "node:fs";
2
+ import { dirname, join } from "node:path";
3
+ import { resolveOkstraHome } from "../../lib/paths.mjs";
4
+ const BROADCAST = "all";
5
+ const USAGE = `okstra chat — cross-session rooms in ~/.okstra/chat
6
+
7
+ Rooms live in the global okstra home. They are not task artifacts.
8
+
9
+ Usage:
10
+ okstra chat rooms
11
+ okstra chat create --room <name>
12
+ okstra chat join --room <name> --name <display>
13
+ okstra chat members --room <name>
14
+ okstra chat send --room <name> --as <display> --to <all|name> --body <text>
15
+ okstra chat unread --room <name> --as <display>
16
+ okstra chat inbox --room <name> --as <display>
17
+ okstra chat log --room <name> --as <display> [--to <all|name>]
18
+ okstra chat ack --room <name> --as <display> --through <id>
19
+ `;
20
+ class ChatError extends Error {
21
+ constructor(message) {
22
+ super(message);
23
+ this.name = "ChatError";
24
+ }
25
+ }
26
+ function chatRoot() {
27
+ return join(resolveOkstraHome(), "chat");
28
+ }
29
+ function indexPath() {
30
+ return join(chatRoot(), "index.json");
31
+ }
32
+ function roomDir(room) {
33
+ return join(chatRoot(), "rooms", encodeURIComponent(room));
34
+ }
35
+ function statePath(room) {
36
+ return join(roomDir(room), "state.json");
37
+ }
38
+ function messagesPath(room) {
39
+ return join(roomDir(room), "messages.jsonl");
40
+ }
41
+ function takeValue(args, index, flag) {
42
+ const value = args[index + 1];
43
+ if (value === undefined || value.startsWith("--")) {
44
+ throw new ChatError(`${flag} requires a value`);
45
+ }
46
+ return value;
47
+ }
48
+ function parseFlags(args, allowed) {
49
+ const out = {};
50
+ for (let i = 0; i < args.length; i++) {
51
+ const flag = args[i];
52
+ if (flag === undefined)
53
+ continue;
54
+ if (!flag.startsWith("--") || !allowed.has(flag)) {
55
+ throw new ChatError(`unknown flag ${flag}`);
56
+ }
57
+ out[flag.slice(2)] = takeValue(args, i++, flag);
58
+ }
59
+ return out;
60
+ }
61
+ function requireFlag(flags, name) {
62
+ const value = flags[name];
63
+ if (value === undefined)
64
+ throw new ChatError(`${name === "name" ? "join requires --name" : `--${name} is required`}`);
65
+ return value;
66
+ }
67
+ function cleanToken(raw, label) {
68
+ const value = raw.trim();
69
+ if (value === "")
70
+ throw new ChatError(`${label} is empty`);
71
+ if (/[\\/\0\n\r]/.test(value)) {
72
+ throw new ChatError(`${label} contains a path separator`);
73
+ }
74
+ return value;
75
+ }
76
+ function cleanDisplayName(raw) {
77
+ const value = cleanToken(raw, "display name");
78
+ if (value === BROADCAST)
79
+ throw new ChatError("display name 'all' is reserved");
80
+ return value;
81
+ }
82
+ function formatLine(message) {
83
+ const to = message.to === BROADCAST ? BROADCAST : `@${message.to}`;
84
+ return `${message.id}:${message.at}:${to}:${message.body}`;
85
+ }
86
+ function emptyIndex() {
87
+ return { rooms: [] };
88
+ }
89
+ function emptyRoom(name) {
90
+ return { name, members: [], nextId: 1, cursors: {} };
91
+ }
92
+ function isIndex(value) {
93
+ if (typeof value !== "object" || value === null)
94
+ return false;
95
+ const rooms = value.rooms;
96
+ return Array.isArray(rooms) && rooms.every((item) => typeof item === "string");
97
+ }
98
+ function isRoomState(value) {
99
+ if (typeof value !== "object" || value === null)
100
+ return false;
101
+ const row = value;
102
+ return (typeof row.name === "string" &&
103
+ Array.isArray(row.members) &&
104
+ typeof row.nextId === "number" &&
105
+ typeof row.cursors === "object" &&
106
+ row.cursors !== null);
107
+ }
108
+ async function readJson(path) {
109
+ try {
110
+ return JSON.parse(await fs.readFile(path, "utf8"));
111
+ }
112
+ catch (err) {
113
+ const code = err.code;
114
+ if (code === "ENOENT")
115
+ return null;
116
+ throw err;
117
+ }
118
+ }
119
+ async function writeJson(path, value) {
120
+ await fs.mkdir(dirname(path), { recursive: true });
121
+ const tmp = `${path}.${process.pid}.tmp`;
122
+ await fs.writeFile(tmp, `${JSON.stringify(value, null, 2)}\n`, "utf8");
123
+ await fs.rename(tmp, path);
124
+ }
125
+ async function withLock(dir, fn) {
126
+ await fs.mkdir(dir, { recursive: true });
127
+ const lockPath = join(dir, ".lock");
128
+ let handle;
129
+ for (let i = 0; i < 50; i++) {
130
+ try {
131
+ handle = await fs.open(lockPath, "wx");
132
+ break;
133
+ }
134
+ catch (err) {
135
+ if (err.code !== "EEXIST")
136
+ throw err;
137
+ await new Promise((resolve) => setTimeout(resolve, 20));
138
+ }
139
+ }
140
+ if (handle === undefined)
141
+ throw new ChatError("could not lock chat store");
142
+ try {
143
+ return await fn();
144
+ }
145
+ finally {
146
+ await handle.close();
147
+ await fs.rm(lockPath, { force: true });
148
+ }
149
+ }
150
+ async function loadIndex() {
151
+ const parsed = await readJson(indexPath());
152
+ if (parsed === null)
153
+ return emptyIndex();
154
+ if (!isIndex(parsed))
155
+ throw new ChatError("chat index is damaged");
156
+ return parsed;
157
+ }
158
+ async function loadRoom(room) {
159
+ const parsed = await readJson(statePath(room));
160
+ if (parsed === null)
161
+ throw new ChatError("room not found");
162
+ if (!isRoomState(parsed))
163
+ throw new ChatError("room state is damaged");
164
+ return parsed;
165
+ }
166
+ async function loadMessages(room) {
167
+ let text;
168
+ try {
169
+ text = await fs.readFile(messagesPath(room), "utf8");
170
+ }
171
+ catch (err) {
172
+ if (err.code === "ENOENT")
173
+ return [];
174
+ throw err;
175
+ }
176
+ const rows = [];
177
+ for (const line of text.split(/\r?\n/)) {
178
+ if (line === "")
179
+ continue;
180
+ const parsed = JSON.parse(line);
181
+ if (typeof parsed === "object" && parsed !== null && "id" in parsed) {
182
+ rows.push(parsed);
183
+ }
184
+ }
185
+ return rows;
186
+ }
187
+ async function appendMessage(room, message) {
188
+ await fs.mkdir(roomDir(room), { recursive: true });
189
+ await fs.appendFile(messagesPath(room), `${JSON.stringify(message)}\n`, "utf8");
190
+ }
191
+ function requireMember(state, name) {
192
+ if (!state.members.includes(name))
193
+ throw new ChatError("not a member");
194
+ }
195
+ function inboxOf(messages, member, afterId) {
196
+ return messages.filter((message) => {
197
+ if (message.id <= afterId)
198
+ return false;
199
+ return message.to === BROADCAST || message.to === member;
200
+ });
201
+ }
202
+ function printLines(lines, empty) {
203
+ process.stdout.write(lines.length === 0 ? `${empty}\n` : `${lines.join("\n")}\n`);
204
+ }
205
+ async function opRooms() {
206
+ const index = await loadIndex();
207
+ printLines(index.rooms, "no rooms");
208
+ return 0;
209
+ }
210
+ async function opCreate(args) {
211
+ const flags = parseFlags(args, new Set(["--room"]));
212
+ const room = cleanToken(requireFlag(flags, "room"), "room name");
213
+ await withLock(chatRoot(), async () => {
214
+ const index = await loadIndex();
215
+ if (index.rooms.includes(room))
216
+ throw new ChatError("room already exists");
217
+ await writeJson(statePath(room), emptyRoom(room));
218
+ await writeJson(indexPath(), { rooms: [...index.rooms, room] });
219
+ });
220
+ process.stdout.write(`created ${room}\n`);
221
+ return 0;
222
+ }
223
+ async function opJoin(args) {
224
+ const flags = parseFlags(args, new Set(["--room", "--name"]));
225
+ if (flags.name === undefined)
226
+ throw new ChatError("join requires --name");
227
+ const room = cleanToken(requireFlag(flags, "room"), "room name");
228
+ const name = cleanDisplayName(flags.name);
229
+ await withLock(roomDir(room), async () => {
230
+ const state = await loadRoom(room);
231
+ if (state.members.includes(name))
232
+ throw new ChatError("display name already taken");
233
+ const next = {
234
+ ...state,
235
+ members: [...state.members, name],
236
+ cursors: { ...state.cursors, [name]: 0 },
237
+ };
238
+ await writeJson(statePath(room), next);
239
+ });
240
+ process.stdout.write(`joined ${room} as ${name}\n`);
241
+ return 0;
242
+ }
243
+ async function opMembers(args) {
244
+ const flags = parseFlags(args, new Set(["--room"]));
245
+ const room = cleanToken(requireFlag(flags, "room"), "room name");
246
+ const state = await loadRoom(room);
247
+ printLines(state.members, "no members");
248
+ return 0;
249
+ }
250
+ function resolveRecipient(state, raw) {
251
+ const value = raw.trim();
252
+ if (value === BROADCAST || value === `@${BROADCAST}`)
253
+ return BROADCAST;
254
+ const name = value.startsWith("@") ? value.slice(1) : value;
255
+ if (!state.members.includes(name))
256
+ throw new ChatError("recipient is not a member");
257
+ return name;
258
+ }
259
+ async function opSend(args) {
260
+ const flags = parseFlags(args, new Set(["--room", "--as", "--to", "--body"]));
261
+ if (flags.to === undefined)
262
+ throw new ChatError("send requires --to");
263
+ if (flags.body === undefined)
264
+ throw new ChatError("send requires --body");
265
+ const room = cleanToken(requireFlag(flags, "room"), "room name");
266
+ const from = cleanDisplayName(requireFlag(flags, "as"));
267
+ const body = flags.body;
268
+ if (body.trim() === "" || /[\n\r]/.test(body)) {
269
+ throw new ChatError("body must be a single non-empty line");
270
+ }
271
+ const id = await withLock(roomDir(room), async () => {
272
+ const state = await loadRoom(room);
273
+ requireMember(state, from);
274
+ const to = resolveRecipient(state, flags.to ?? "");
275
+ const message = {
276
+ id: state.nextId,
277
+ at: new Date().toISOString(),
278
+ from,
279
+ to,
280
+ body,
281
+ };
282
+ await appendMessage(room, message);
283
+ await writeJson(statePath(room), { ...state, nextId: state.nextId + 1 });
284
+ return message.id;
285
+ });
286
+ process.stdout.write(`sent ${id}\n`);
287
+ return 0;
288
+ }
289
+ async function opUnread(args) {
290
+ const flags = parseFlags(args, new Set(["--room", "--as"]));
291
+ const room = cleanToken(requireFlag(flags, "room"), "room name");
292
+ const name = cleanDisplayName(requireFlag(flags, "as"));
293
+ const state = await loadRoom(room);
294
+ requireMember(state, name);
295
+ const after = state.cursors[name] ?? 0;
296
+ const rows = inboxOf(await loadMessages(room), name, after);
297
+ printLines(rows.map(formatLine), "no unread");
298
+ return 0;
299
+ }
300
+ async function opInbox(args) {
301
+ const flags = parseFlags(args, new Set(["--room", "--as"]));
302
+ const room = cleanToken(requireFlag(flags, "room"), "room name");
303
+ const name = cleanDisplayName(requireFlag(flags, "as"));
304
+ const state = await loadRoom(room);
305
+ requireMember(state, name);
306
+ const rows = inboxOf(await loadMessages(room), name, 0);
307
+ printLines(rows.map(formatLine), "no inbox");
308
+ return 0;
309
+ }
310
+ async function opLog(args) {
311
+ const flags = parseFlags(args, new Set(["--room", "--as", "--to"]));
312
+ const room = cleanToken(requireFlag(flags, "room"), "room name");
313
+ const name = cleanDisplayName(requireFlag(flags, "as"));
314
+ const state = await loadRoom(room);
315
+ requireMember(state, name);
316
+ let rows = await loadMessages(room);
317
+ if (flags.to !== undefined) {
318
+ const to = resolveRecipient(state, flags.to);
319
+ rows = rows.filter((message) => message.to === to);
320
+ }
321
+ printLines(rows.map(formatLine), "no messages");
322
+ return 0;
323
+ }
324
+ async function opAck(args) {
325
+ const flags = parseFlags(args, new Set(["--room", "--as", "--through"]));
326
+ const room = cleanToken(requireFlag(flags, "room"), "room name");
327
+ const name = cleanDisplayName(requireFlag(flags, "as"));
328
+ const through = Number.parseInt(requireFlag(flags, "through"), 10);
329
+ if (!Number.isInteger(through) || through < 1) {
330
+ throw new ChatError("--through must be a positive message id");
331
+ }
332
+ await withLock(roomDir(room), async () => {
333
+ const state = await loadRoom(room);
334
+ requireMember(state, name);
335
+ const messages = await loadMessages(room);
336
+ if (!messages.some((message) => message.id === through)) {
337
+ throw new ChatError("message id not found");
338
+ }
339
+ await writeJson(statePath(room), {
340
+ ...state,
341
+ cursors: { ...state.cursors, [name]: through },
342
+ });
343
+ });
344
+ process.stdout.write(`acked through ${through}\n`);
345
+ return 0;
346
+ }
347
+ export async function run(args) {
348
+ if (args.length === 0 || args.includes("--help") || args.includes("-h")) {
349
+ process.stdout.write(USAGE);
350
+ return args.length === 0 ? 2 : 0;
351
+ }
352
+ const op = args[0];
353
+ const rest = args.slice(1);
354
+ try {
355
+ switch (op) {
356
+ case "rooms":
357
+ return await opRooms();
358
+ case "create":
359
+ return await opCreate(rest);
360
+ case "join":
361
+ return await opJoin(rest);
362
+ case "members":
363
+ return await opMembers(rest);
364
+ case "send":
365
+ return await opSend(rest);
366
+ case "unread":
367
+ return await opUnread(rest);
368
+ case "inbox":
369
+ return await opInbox(rest);
370
+ case "log":
371
+ return await opLog(rest);
372
+ case "ack":
373
+ return await opAck(rest);
374
+ default:
375
+ process.stderr.write(`unknown chat subcommand: ${op}\n\n${USAGE}`);
376
+ return 2;
377
+ }
378
+ }
379
+ catch (err) {
380
+ const message = err instanceof Error ? err.message : String(err);
381
+ process.stderr.write(`error: ${message}\n`);
382
+ return 1;
383
+ }
384
+ }
385
+ //# sourceMappingURL=chat.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chat.mjs","sourceRoot":"","sources":["../../../src/commands/chat/chat.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,MAAM,SAAS,GAAG,KAAK,CAAC;AAExB,MAAM,KAAK,GAAG;;;;;;;;;;;;;;CAcb,CAAC;AAqBF,MAAM,SAAU,SAAQ,KAAK;IAC3B,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC;IAC1B,CAAC;CACF;AAED,SAAS,QAAQ;IACf,OAAO,IAAI,CAAC,iBAAiB,EAAE,EAAE,MAAM,CAAC,CAAC;AAC3C,CAAC;AAED,SAAS,SAAS;IAChB,OAAO,IAAI,CAAC,QAAQ,EAAE,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OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,OAAO,IAAI,CAAC,CAAC;QAC5C,OAAO,CAAC,CAAC;IACX,CAAC;AACH,CAAC"}
@@ -9,6 +9,7 @@ export const USER_SKILL_NAMES = Object.freeze([
9
9
  "okstra-run",
10
10
  "okstra-manager",
11
11
  "okstra-memory",
12
+ "okstra-chat",
12
13
  "okstra-inspect",
13
14
  "okstra-rollup",
14
15
  "okstra-usage",
@@ -1 +1 @@
1
- {"version":3,"file":"skill-catalog.mjs","sourceRoot":"","sources":["../../src/lib/skill-catalog.mts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,+EAA+E;AAC/E,+EAA+E;AAC/E,0EAA0E;AAC1E,8CAA8C;AAE9C,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC;IAC5C,cAAc;IACd,kBAAkB;IAClB,YAAY;IACZ,gBAAgB;IAChB,eAAe;IACf,gBAAgB;IAChB,eAAe;IACf,cAAc;IACd,qBAAqB;IACrB,wBAAwB;IACxB,eAAe;IACf,sBAAsB;IACtB,oBAAoB;CACrB,CAAC,CAAC;AAEH,2EAA2E;AAC3E,8EAA8E;AAC9E,+EAA+E;AAC/E,oCAAoC;AACpC,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,CAAC;IAChD,QAAQ;IACR,uBAAuB;IACvB,sBAAsB;IACtB,oBAAoB;IACpB,sBAAsB;IACtB,yBAAyB;IACzB,kBAAkB;IAClB,cAAc;IACd,iBAAiB;IACjB,sEAAsE;IACtE,0EAA0E;IAC1E,gEAAgE;IAChE,eAAe;IACf,gBAAgB;IAChB,aAAa;IACb,sBAAsB;IACtB,qBAAqB;CACtB,CAAC,CAAC;AAEH,MAAM,UAAU,cAAc;IAC5B,OAAO,CAAC,GAAG,gBAAgB,CAAC,CAAC;AAC/B,CAAC;AAED,MAAM,UAAU,kBAAkB;IAChC,OAAO,CAAC,GAAG,oBAAoB,CAAC,CAAC;AACnC,CAAC"}
1
+ {"version":3,"file":"skill-catalog.mjs","sourceRoot":"","sources":["../../src/lib/skill-catalog.mts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,+EAA+E;AAC/E,+EAA+E;AAC/E,0EAA0E;AAC1E,8CAA8C;AAE9C,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC;IAC5C,cAAc;IACd,kBAAkB;IAClB,YAAY;IACZ,gBAAgB;IAChB,eAAe;IACf,aAAa;IACb,gBAAgB;IAChB,eAAe;IACf,cAAc;IACd,qBAAqB;IACrB,wBAAwB;IACxB,eAAe;IACf,sBAAsB;IACtB,oBAAoB;CACrB,CAAC,CAAC;AAEH,2EAA2E;AAC3E,8EAA8E;AAC9E,+EAA+E;AAC/E,oCAAoC;AACpC,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,CAAC;IAChD,QAAQ;IACR,uBAAuB;IACvB,sBAAsB;IACtB,oBAAoB;IACpB,sBAAsB;IACtB,yBAAyB;IACzB,kBAAkB;IAClB,cAAc;IACd,iBAAiB;IACjB,sEAAsE;IACtE,0EAA0E;IAC1E,gEAAgE;IAChE,eAAe;IACf,gBAAgB;IAChB,aAAa;IACb,sBAAsB;IACtB,qBAAqB;CACtB,CAAC,CAAC;AAEH,MAAM,UAAU,cAAc;IAC5B,OAAO,CAAC,GAAG,gBAAgB,CAAC,CAAC;AAC/B,CAAC;AAED,MAAM,UAAU,kBAAkB;IAChC,OAAO,CAAC,GAAG,oBAAoB,CAAC,CAAC;AACnC,CAAC"}
@@ -157,9 +157,9 @@ Runtime entry points are consolidated in Python packages. Bash and skills only c
157
157
  - Host and provider registries remain separate: the active registered host owns the native lead session, while non-native providers run through their registered CLI wrappers.
158
158
  - [`skills/okstra-setup/SKILL.md`](../skills/okstra-setup/SKILL.md) — **first-run bootstrap**. Runs `okstra install` and creates `project.json`.
159
159
  - [`skills/okstra-run/SKILL.md`](../skills/okstra-run/SKILL.md) — host-aware in-session entry point that starts an okstra task in the current registered host session and calls `prepare_task_bundle` directly.
160
- - Thirteen skills are user-invocable: `skills/okstra-setup/SKILL.md`, `skills/okstra-brief-gen/SKILL.md`, `skills/okstra-run/SKILL.md`, `skills/okstra-manager/SKILL.md`, `skills/okstra-memory/SKILL.md`, `skills/okstra-inspect/SKILL.md`, `skills/okstra-rollup/SKILL.md`, `skills/okstra-usage/SKILL.md`, `skills/okstra-schedule-gen/SKILL.md`, `skills/okstra-container-build/SKILL.md`, `skills/okstra-pr-gen/SKILL.md`, `skills/okstra-user-response/SKILL.md`, and `skills/okstra-code-review/SKILL.md`. Only these are copied into the agent skill home. They cover brief authoring, phase execution, cross-project manager task coordination, global Memory Book storage/search, read-side status/history/report/time/logs/cost/errors/recap, task-group-level aggregation of run results (rollup), project-wide historical resource usage, schedule support, local container deployment, PR description generation, clarification-response submission, and census-based code review of a stage or branch diff. `okstra-manager` uses `okstra manager` CLI JSON/launch packets as the source of truth, and stores manager-owned plans, assignments, directives, snapshots, and events under `~/.okstra/managers/<manager-id>/`. `okstra-rollup` is a read-side layer that fans the single-task aggregators from `okstra-inspect` (time/errors/recap) out to a task group or the whole project catalog. The `okstra rollup` CLI owns deterministic aggregation, while the skill (LLM) writes only the synthesized report summary. `okstra-usage` is a separate read-only resource snapshot grouped by lifecycle task type; it does not replace single-task `okstra-inspect` detail or the status/report digest from `okstra-rollup`. The canonical definition of `okstra-inspect` read-side facets is the subcommand table in `skills/okstra-inspect/SKILL.md`. `okstra-inspect logs` provides a read-only inventory and cleanup guidance for the live-log sidecars that the Codex/Antigravity wrappers write on every dispatch at the resolved `<run-dir>/prompts/<worker>-prompt-<phase>-<seq>.log`; for stage executions, the stage-qualified `run_dir` includes `stage-<N>/`. `okstra-inspect cost` summarizes `okstra context-cost`; `okstra-inspect errors` collects a task's okstra-run error logs into a timestamped Markdown error report and prints a summary; and `okstra-inspect recap` answers free-form questions about `.okstra` artifacts in addition to summarizing phases before and after each task run.
160
+ - Fourteen skills are user-invocable: `skills/okstra-setup/SKILL.md`, `skills/okstra-brief-gen/SKILL.md`, `skills/okstra-run/SKILL.md`, `skills/okstra-manager/SKILL.md`, `skills/okstra-memory/SKILL.md`, `skills/okstra-chat/SKILL.md`, `skills/okstra-inspect/SKILL.md`, `skills/okstra-rollup/SKILL.md`, `skills/okstra-usage/SKILL.md`, `skills/okstra-schedule-gen/SKILL.md`, `skills/okstra-container-build/SKILL.md`, `skills/okstra-pr-gen/SKILL.md`, `skills/okstra-user-response/SKILL.md`, and `skills/okstra-code-review/SKILL.md`. Only these are copied into the agent skill home. They cover brief authoring, phase execution, cross-project manager task coordination, global Memory Book storage/search, global chat rooms, read-side status/history/report/time/logs/cost/errors/recap, task-group-level aggregation of run results (rollup), project-wide historical resource usage, schedule support, local container deployment, PR description generation, clarification-response submission, and census-based code review of a stage or branch diff. `okstra-manager` uses `okstra manager` CLI JSON/launch packets as the source of truth, and stores manager-owned plans, assignments, directives, snapshots, and events under `~/.okstra/managers/<manager-id>/`. `okstra-rollup` is a read-side layer that fans the single-task aggregators from `okstra-inspect` (time/errors/recap) out to a task group or the whole project catalog. The `okstra rollup` CLI owns deterministic aggregation, while the skill (LLM) writes only the synthesized report summary. `okstra-usage` is a separate read-only resource snapshot grouped by lifecycle task type; it does not replace single-task `okstra-inspect` detail or the status/report digest from `okstra-rollup`. The canonical definition of `okstra-inspect` read-side facets is the subcommand table in `skills/okstra-inspect/SKILL.md`. `okstra-inspect logs` provides a read-only inventory and cleanup guidance for the live-log sidecars that the Codex/Antigravity wrappers write on every dispatch at the resolved `<run-dir>/prompts/<worker>-prompt-<phase>-<seq>.log`; for stage executions, the stage-qualified `run_dir` includes `stage-<N>/`. `okstra-inspect cost` summarizes `okstra context-cost`; `okstra-inspect errors` collects a task's okstra-run error logs into a timestamped Markdown error report and prints a summary; and `okstra-inspect recap` answers free-form questions about `.okstra` artifacts in addition to summarizing phases before and after each task run.
161
161
  - Internal operating contracts—`context-loader` / `team-contract` / `convergence` / `report-writer` and the lead contract—have moved to `prompts/lead/*.md`. Language-specific coding preflight for implementation/verification workers has moved to `prompts/coding-preflight/*` (overview router + clean-code + three-stage language/framework/architecture selection). All are runtime resources installed under `~/.okstra/prompts/` and are not discoverable as skills. The generated launch prompt provides the lead with absolute paths, and reinstalling prunes the legacy exact-name skill directories `okstra-context-loader` / `okstra-team-contract` / `okstra-convergence` / `okstra-report-writer` / `okstra-coding-preflight` / `okstra`.
162
- - Plugin manifest: [`../../.claude-plugin/plugin.json`](../.claude-plugin/plugin.json) — referenced by the supplementary `npx skills@latest add Devonshin/okstra` channel. Use `npx okstra@latest install` for normal setup. The plugin manifest exposes only the thirteen user entry points (`okstra-setup`, `okstra-brief-gen`, `okstra-run`, `okstra-manager`, `okstra-memory`, `okstra-inspect`, `okstra-rollup`, `okstra-usage`, `okstra-schedule-gen`, `okstra-container-build`, `okstra-pr-gen`, `okstra-user-response`, `okstra-code-review`).
162
+ - Plugin manifest: [`../../.claude-plugin/plugin.json`](../.claude-plugin/plugin.json) — referenced by the supplementary `npx skills@latest add Devonshin/okstra` channel. Use `npx okstra@latest install` for normal setup. The plugin manifest exposes only the fourteen user entry points (`okstra-setup`, `okstra-brief-gen`, `okstra-run`, `okstra-manager`, `okstra-memory`, `okstra-chat`, `okstra-inspect`, `okstra-rollup`, `okstra-usage`, `okstra-schedule-gen`, `okstra-container-build`, `okstra-pr-gen`, `okstra-user-response`, `okstra-code-review`).
163
163
  - Installation location: `~/.claude/skills/<name>/SKILL.md` or `~/.agents/skills/<name>/SKILL.md`.
164
164
  - Release procedure: [`../../RELEASING.md`](../RELEASING.md) — npm publish flow and release-please / manual fallback.
165
165
 
@@ -747,8 +747,8 @@ The latest final report opens in `$EDITOR`, and after saving, the same phase rer
747
747
  The default for an `implementation-planning` clarification rerun is **full re-verification**. However, if an answer has only local impact and the code is unchanged, the lead re-verifies only the downstream closure of affected stages and carries forward the other stages' plan-item verdicts from the previous run. The decision is split between deterministic CLI logic and lead judgment.
748
748
 
749
749
  - **C1 (CLI decision, deterministic)**: The `executorWorktree.baseRef` in the previous run's `state/active-run-context-implementation-planning-<prev-seq>.json` must match the current run's base-ref SHA. If they differ, the code changed, so the result is immediately `full`.
750
- - **C2 (lead judgment)**: The set of Stage Map stage numbers affected by the answer. Never include a number not in the Stage Map. If the mapping is uncertain or the answer reverses the selected Option/approach, pass an **empty set** and fall back to `full`.
751
- - **Closure cutoff**: `okstra incremental-scope` calculates the `downstream_stage_closure` of affected stages in the `implementationPlanning.stageMap` dependency graph. If its size is **more than half** of all stages, the result is `full`; otherwise it outputs `{mode, reverify_stages, carry_stages, reason}` JSON.
750
+ - **C2 (lead judgment)**: The set of Stage Map stage numbers affected by the answer. Never include a number not in the Stage Map. An answered `C-NNN` that traces to no stage is `mode: unresolved`, not full — ask the user for those stage numbers (`--impacted`) rather than widening the whole re-run. If the answer reverses the selected Option, Stage Map, or approach, pass `--full-reason`; that is the only structural path that still forces `full`.
751
+ - **Closure cutoff**: `okstra incremental-scope` calculates the `downstream_stage_closure` of affected stages in the `implementationPlanning.stageMap` dependency graph. If its size is **more than half** of all stages, the result is `full`; otherwise it outputs `{mode, reverify_stages, carry_stages, reason}` JSON. When the wizard pin is `auto` and the CLI returns `mode == "incremental"`, the lead must not upgrade to full.
752
752
 
753
753
  ```bash
754
754
  okstra incremental-scope --prev-data <prev data.json> --cur-base-sha <sha> --prev-base-sha <sha> --impacted 2,3
@@ -839,9 +839,10 @@ In Claude, use the `status` subflow of the seeded `okstra-inspect` skill to answ
839
839
  Resume decision rules:
840
840
 
841
841
  - Resume the current run: if `latestResumeCommandPath` exists, use that path first.
842
- - Restart the current phase: run again with the same `task-key` and current `task-type`.
843
- - Start the next phase: if `workflow.nextRecommendedPhase.status` is `ready`, prepare the next `okstra.sh` run with its `phase`.
844
- - Additional material required: if that `status` is `pending` or `blocked`, the pointer carries no phase. Read its `rationale`, augment the brief, and rerun the phase that left the pointer unsettled.
842
+ - Await user approval: if `workflow.awaitingApproval` is true, ask the user to approve the plan (`okstra-run` implementation wizard, or `--approve`). Do not start implementation as if the gate were already cleared, and do not re-run `implementation-planning`.
843
+ - Restart the current phase: run again with the same `task-key` and current `task-type` only when `awaitingApproval` is false and the pointer is not `ready`.
844
+ - Start the next phase: if `workflow.nextRecommendedPhase.status` is `ready` and `awaitingApproval` is false, prepare the next `okstra.sh` run with its `phase`.
845
+ - Additional material required: if that `status` is `pending` or `blocked`, the pointer carries no phase. Read its `rationale`. After planning, `blocked` means answer the named `C-NNN` rows with `okstra-user-response` first; do not re-run planning until those answers exist.
845
846
  - Nothing left to run: `status` `terminal` means the lifecycle ended at this phase.
846
847
 
847
848
  ## Final report structure
@@ -886,7 +887,8 @@ Entry points:
886
887
  - Python routing references: `scripts/okstra_ctl/report_views.py` owns the version split; `scripts/okstra_ctl/report_html/router.py` maps all v2 task types to dedicated view-model builders and templates. The HTML JavaScript response serializer remains byte-identical to Python `serialize_user_response`.
887
888
  - CLI: `scripts/okstra-render-report-views.py <final-report.data.json|final-report.md>` or delegated Node wrapper `bin/okstra render-views <path>`.
888
889
  - Validation: `validators/validate-report-views.py` checks schema/source/template digests, required human fields, form controls, external assets, SVG/table ID parity, and Response ID parity. The v2 renderer rejects an unknown task type instead of falling back to a generic page.
889
- - User-response sidecar schema source of truth: `templates/reports/user-response.template.md`.
890
+ - User-response sidecar schema source of truth: `templates/reports/user-response.template.md`. The in-session skill reads `okstra user-response show-view`, then the cited `path:line` artifacts and linked plan items that view lists, before asking. The recorded answer still comes from `options[]` via `--option-number`. Task pick, each clarification, and the record confirmation use the current host's native question tool from the relay `native-single` mapping (`AskUserQuestion`, `ask_user_question`, or `request_user_input`). A numbered list is only the fallback when that tool is missing or the option count misses `nativeLimits`.
891
+ - In-run user confirmation before an approval blocker follows the same briefing order and the same host picker: the lead investigates cited plan items, worker findings, and files, then asks through the adapter `prompt_user` mapping (`prompts/lead/okstra-lead-contract.md`).
890
892
 
891
893
  Generating a view never modifies the original final-report MD.
892
894