octwin-cli 0.8.14 → 0.8.15

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 CHANGED
@@ -1,1008 +1,1017 @@
1
- # Changelog — octwin-cli
2
-
3
- All notable changes to the `octwin` CLI (npm package [`octwin-cli`](https://www.npmjs.com/package/octwin-cli)).
4
- Format: [Keep a Changelog](https://keepachangelog.com/) — newest first, bucketed into
5
- **Added · Changed · Deprecated · Removed · Fixed · Security**. The platform-wide view lives in the
6
- repo root [`CHANGELOG.md`](../../CHANGELOG.md); this file is the CLI-only cut that ships with the package.
7
-
8
- ## [Unreleased]
9
-
10
- ## [0.8.14] - 2026-10-06
11
-
12
- ### Added
13
- - **`octwin seed --reset`** — archive every row the pack's demo loaded, then load it again. Needed
14
- once for demo rows seeded before 2026-10-05 (the seed says so), and a clean slate on demand; records
15
- a customer made are never touched.
16
- - **`octwin records <entity> --search "<words>"`** — the entity's ranked search (fuzzy, plus semantic
17
- when the entity declares it), best match first, each row printed with its score. The platform has
18
- served it to the console for months; the CLI never asked. `--json` returns the rows with their scores.
19
- - **`press:<label>` in `octwin chat --script`, and `--press <label>`.** Taps the button of the reply just
20
- received by its label — exactly, or the same words without emoji or case, or the one label containing
21
- them. A form or checkout button's tap id carries its run id (`t:resume:…:run_id=…`), which exists only
22
- once the reply arrives, so a script could not get past the first form step: `tap:` needs an id nobody
23
- can write in advance. No match, or several buttons, stops the script and lists the buttons. A lone
24
- `--press` picks from the reply the conversation is waiting on. The rules are the AI Author's `press`,
25
- byte for byte (`src/lib/press.ts`). An older CLI sends a `press:` line as a typed message.
26
-
27
- ### Fixed
28
- - **`octwin chat` prints a card's link buttons and its forms.** A button that opens a link prints as
29
- `[link] title → url` (a card may now carry links beside its reply buttons), and a form prints as
30
- `[flow form] …` — it compared the hint type `'flow'`, which the wire never sends (`form_flow`).
31
- - **`--json` output always parses.** `records --json` and `projects create --json` printed a
32
- `→ Reading …` line in front of their JSON, and `logs --json` with no conversations printed a sentence
33
- and no JSON at all (reported 2026-10-01). Under `--json`, stdout now carries the result and nothing
34
- else — progress, tables and hints go to stderr — and every write verb of a JSON command (`records
35
- create`, `work note`, `agents set`, `catalog stock`, `scheduling rule add`, `projects rm --yes`, …)
36
- returns what the platform answered. A test runs every JSON command and parses its stdout.
37
- - **`octwin chat` prints the pictures, files, voice notes and map pins a reply carries.** Only a reply's
38
- text and buttons were printed, so a reply that sent a picture read as a caption with nothing under it.
39
- Now `[image] <path>` (without the signed query), `[file] <name> → <url>`, `[voice note] 12s → <url>`,
40
- `[location] <name> (lat, long)`, and `(image)` on a carousel card that has a picture
41
- (`src/lib/media-lines.ts`).
42
-
43
- ### Changed
44
- - **`--json` on a command that has no JSON output is refused by name** (`whoami`, `deploy`, `validate`,
45
- …), with the list of commands that have it. It used to print the prose to stderr and leave stdout
46
- empty. `chat --json` and `login --json` print one JSON object per line, as before.
47
- - **Under `--json`, the progress lines move from stdout to stderr.** A script that read them from stdout
48
- reads them from stderr now; human output (no `--json`) is unchanged.
49
- - **`octwin pull` can pull an Octwin (first-party) pack.** The platform now lets a workspace read the
50
- source of its own packs and of Octwin's — never another workspace's — and the 403 hint says so. A
51
- platform change: an older CLI pulls first-party packs too, it only prints the older hint.
52
-
53
- ## [0.8.13] - 2026-09-27
54
-
55
- ### Added
56
- - **`octwin records archive <id>` / `restore <id>`.** Archive is how a record leaves use — test data
57
- included: it drops out of every list, count and report and fires the entity's `on.archived`
58
- reactions, exactly like the console's Archive; `restore` undoes it. There is no delete, on the
59
- platform or here, and `octwin records --help` now says so.
60
-
61
- ### Fixed
62
- - **`octwin chat` said the AI Agent wrote every message.** A reminder that fired mid `--script` (a
63
- `schedule_notify`, a reaction) printed as `← <body>`, was taken for the turn's reply, and ended
64
- the turn on it — so the real reply looked lost while `octwin logs` showed the flow had worked.
65
- Each line now says who sent it: `← [notify] …` (not the turn's answer — the wait for the real
66
- reply goes on), `← [operator: Name] …` (a person in Live chat), `← [platform] …` (a handoff
67
- joining or returning); plain `← …` is the AI Agent. After the last turn the stream stays open
68
- 3 s more, so a late message prints (marked "after the last turn") instead of reaching a closed
69
- connection. Needs a platform that stamps `source: 'notify'` on web renders; an older one just
70
- prints notifies unlabelled, as before.
71
- - **The "no such template" hint named a file the platform never loads.** It said
72
- `templates/<name>.yaml`; pack templates load only as `templates/<name>.template.yaml`, so a
73
- template saved as the hint said was silently ignored.
74
-
75
- ### Changed
76
- - **`octwin validate` runs the platform's FULL check by default — and needs no login for it.** The
77
- offline checks are a subset, and a subset that passes read as "deploy will pass": it passed a pack
78
- the full check refused (a scaffold flow left behind with Arabic copy only, in a pack that ships
79
- English). Now `validate` runs the offline checks, then the full one: through your workspace when you
80
- have a token AND a `--project` (which also confirms the project exists), otherwise through the
81
- platform's public validate route with no credential. When it cannot reach the full check — no url,
82
- offline, rate-limited, an older platform — the LAST line says *"only the OFFLINE check ran — a
83
- PARTIAL check"* and why, and it exits 0 as before. `--remote` now means "the full check is
84
- required" (not reaching it is an error); the new `--offline` runs only the subset.
85
- - **The scaffold's example `browse` flow says it is an example.** Its header, its copy file and its
86
- `manifest.yaml` line now say to replace it, or delete the flow, every `browse.locale.*.yaml` and the
87
- `flows:` line together — a leftover never loads, but a second language makes it fail validation.
88
-
89
- ## [0.8.12] - 2026-09-25
90
-
91
- ### Changed
92
- - **The package pointed its `homepage` at npm — the page it is rendered on.** It is
93
- <https://octwin.ai> now, and the README's Links section gains the platform, the guides and the
94
- marketplace. The README describes Octwin at length and linked only to npm and nodejs.org.
95
- - **`octwin usage` with a project-pinned token reports that project.** The platform now treats a
96
- token's project pin as a ceiling on every route, so a pinned token is refused on the
97
- workspace-wide rollup. `usage` asks `whoami` for the pin and reads the project view instead of
98
- printing a 403 — which is what its help text (`project if pinned, else workspace`) always said.
99
-
100
- ### Fixed
101
- - **`octwin chat` sat out its whole 45-second wait on every message during a live handoff, and
102
- read as hung.** While a person holds the conversation (or one has been asked for) the AI Agent
103
- deliberately answers nothing, and the CLI could not tell that from a slow pack. The platform now
104
- says so with a `held` event on the web stream; `chat` prints
105
- *"⏸ a person is holding this conversation — the AI Agent will not reply…"* (or *"waiting for a
106
- person to join…"*), still collects any operator line replayed by that message, and returns. A
107
- held turn is not a failure: it exits 0, and `--script` carries on to the next line, so the
108
- customer's side of a handoff can be scripted. Needs a platform that sends `held`; an older one
109
- behaves as before. Reported in `xpeng-egypt/FEEDBACK.md`, session 3.
110
-
111
- ## [0.8.11] - 2026-09-07
112
-
113
- ### Fixed
114
- - **`octwin login` erased your own tooling report — the CLI was blanking what it had just
115
- told the platform.** Two calls built their `authorization` header by hand instead of going
116
- through `authHeaders`: `login`'s post-save "here's what your token reaches" echo, and
117
- `chat`'s tenant/project derivation. Both authenticate, so both stamp the token's client
118
- report (added in 0.8.9) — and a hand-built header stamps **NULL**, wiping the CLI version
119
- and reference hash the platform had recorded.
120
-
121
- Caught within an hour of 0.8.9 reaching staging: a workspace reported `0.8.9 · reference
122
- current` at 12:16 and read `not reported` at 12:34. That looked exactly like the documented
123
- "the column holds what ran LAST" behaviour and was really the CLI erasing its own row.
124
- `cli-routes.test.ts` now fails on any hand-built bearer header, with a non-vacuity floor —
125
- this package sits outside the repo's eslint scope, so a text guard is the only rung available.
126
-
127
- ## [0.8.10] - 2026-09-07
128
-
129
- ### Fixed
130
- - **`octwin memos` failed with `400 project required` for a tenant-wide token — the exact
131
- command the nudge tells you to run.** Every networked command can end with
132
- *"✉ N memos from the platform — read them: `octwin memos`"*, and running precisely that with
133
- an unpinned token answered a 400. Measured on staging: the nudge fired during a
134
- `deploy --project …` (which supplied a project) and then named a command that could not run.
135
-
136
- A memo has no project dimension to scope by — neither `pack_memos` nor `pack_memo_reads`
137
- carries a `project_id`, and the read ledger is keyed by tenant — so the three call sites now
138
- use `/api/self/t/memos`. Passing `--project` still works and is no longer needed.
139
-
140
- ## [0.8.9] - 2026-09-07
141
-
142
- ### Added
143
- - **Every authenticated request now says which CLI and which capability reference you are on.**
144
- Two headers off `authHeaders` — `x-octwin-cli` and `x-octwin-kb` (the `content_hash` of your
145
- pulled reference) — so `deploy`, `validate --remote`, `status`, `chat`, `logs` and `memos` all
146
- carry them, from one place. The platform stores them against your deploy token and shows them in
147
- the console (Settings → API tokens, and Platform → Packs → Feedback → Author tooling for us).
148
-
149
- **Why the platform needs this from you.** Almost every field report so far turned out to be
150
- either already fixed in a newer CLI or written against a stale reference — three very different
151
- answers that look identical without these two facts. They were captured on `octwin feedback`
152
- only, so an author who never filed a report was invisible. Nothing here affects auth: a request
153
- that sends neither header authenticates exactly as before, and a value that could not travel as
154
- a header (a corrupt `package.json`, an interrupted pull) is dropped rather than sent.
155
-
156
- ### Fixed
157
- - **The upgrade notice was skipped under `npx` — silencing the population most likely to be
158
- stale.** The premise was that "`@latest` already resolves the newest", which holds for
159
- `npx octwin-cli@latest` and is false for the bare `npx octwin-cli` the docs put in front of
160
- external developers: npm serves that from its **cache**, so it can be arbitrarily old. Under
161
- `@latest` the check is self-silencing anyway (you are already newest), so keeping it costs
162
- nothing — only the advice line differs, because there is no global install to reinstall.
163
-
164
- ## [0.8.8] - 2026-09-06
165
-
166
- ### Added
167
- - **`octwin login` can sign you in through a browser — no token is pasted anywhere.** Run it with
168
- no `--token` and it prints an approval link:
169
-
170
- ```
171
- Open this link to approve: https://app.octwin.ai/cli-login?code=WDJB-MJHT
172
- Code shown on that page: WDJB-MJHT
173
- ```
174
-
175
- A workspace admin opens it, checks which machine is asking, and clicks Approve; the CLI collects a
176
- 30-day token by itself and saves it exactly where `--token` would have. `octwin login --token oct_…`
177
- is unchanged, and CI should still skip login entirely and set `PACK_PLATFORM_URL` + `PACK_TOKEN`.
178
-
179
- **The wait is bounded and resumable, because this CLI is mostly driven by an agent.** An agent's
180
- shell call is killed after about two minutes, and a wait that outlives its caller is worse than a
181
- short one — the process dies mid-handshake and the code the human is still typing belongs to
182
- nothing. So `login` waits 90 seconds, then exits **75** (`EX_TEMPFAIL`) with the handshake kept in
183
- `~/.octwin/pending-login.json`; running it again resumes the **same** code, which the platform
184
- keeps alive for ten minutes. `0` still means signed in and `1` still means failed, so an agent
185
- branches on the exit code instead of parsing prose. `--wait <seconds>` overrides the 90 (`--wait 0`
186
- prints the code and returns at once), and `--json` prints the same facts as an object.
187
-
188
- **Approve only a link you opened because you ran the command.** The link carries the code
189
- (RFC 8628 `verification_uri_complete`), so the click *is* the consent: approving a link somebody
190
- sent you would connect their machine to your workspace. The console says so on the page. The code
191
- is printed here too, and shown there, so you can always tell one request from another.
192
-
193
- The pending handshake gets its own file rather than a new key in `credentials.json`: every value
194
- in that file is a token, and its one reserved key (`default_url`) is collision-free only because a
195
- platform url always contains `://`. A second value shape there would end that argument.
196
-
197
- - **A 401 now points at `octwin login`, not at the console.** With a 30-day browser token, renewing is
198
- one command; the old hint sent people to mint a replacement by hand. Mint a token yourself if you
199
- want a different lifetime — the console offers 30 / 90 days / a year / never.
200
-
201
- ## [0.8.7] - 2026-09-06
202
-
203
- ### Added
204
- - **`validate` now reads a map's KEYS, not only its values.** The declaration walker reported four
205
- things — an unknown key, a missing `required` key, a wrong scalar type, a value outside a closed
206
- `enum` — and every one of them is about a VALUE. But a map's keys carry meaning in several
207
- declarations (`roles.yaml` grant resources and verbs, `xrm.yaml` entity names), and those keys had
208
- no check at all. Rule 5 replays `propertyNames` — both the `enum` and the `pattern` form.
209
-
210
- This is why publishing the RBAC vocabulary was worth doing. A pack author wrote `case:` where the
211
- grant key is `record.case`, passed offline `validate` clean, and learned the truth one bad guess at
212
- a time from `--remote` round-trips. They gave up on custom RBAC over it. The check now says
213
- `not a valid key here — must be one of "record.case", …` before a deploy is attempted.
214
-
215
- It stays inside the file's false-positive rule because it is a **faithful replay**: the same `enum`
216
- membership and the same JS regex engine Zod itself runs, over a pattern the platform generated. A
217
- pattern this engine cannot compile is treated like a combinator — walk away, do not guess.
218
-
219
- Verified 2026-09-06 against the shipped binary: across all 23 marketplace packs rule 5 reports
220
- **nothing**, with 10 of the 12 pulled declaration schemas carrying `propertyNames` (so the silence
221
- is a result, not an unexercised branch). A deliberately broken key is caught on both branches — a
222
- role named `Regional-Agent` against `^[a-z][a-z0-9_]*$`, and a grant key `case:` against an enum
223
- vocabulary — each naming the file, the path and the rule it broke.
224
-
225
- ### Fixed
226
- - **`deploy` had stopped printing its seed counts entirely.** `printDeploySuccess` read
227
- `r.summary.records` / `.updated` / `.images` / `.rules` / `.failed`, but the deploy route's
228
- `summary` is a run-log **string** (`"clinic v1.2.0 — {…}"`), not an object. So every field was
229
- `undefined`, `parts` stayed empty, and the `if (parts.length)` guard turned *"I am reading the
230
- wrong field"* into *"there was nothing to say"* — the block printed nothing and looked like a
231
- deploy that simply seeded no rows. The counts have been on `r.seeded`, keyed by seed kind, and
232
- `printSeedCounts` already renders them (filtering zeros, which is what makes a partial seed
233
- legible). The dead block is gone and `printSeedCounts` is called instead.
234
-
235
- Same shape as the bug 0.8.6 fixed in `validate`: *no data* and *no problem* rendering identically.
236
- Two independent places in this CLI reached it within one week.
237
-
238
- ## [0.8.6] - 2026-09-04
239
-
240
- ### Changed
241
- - **`validate` can no longer print a `✓` for a check that did not run.** Each of the eight
242
- checks now RETURNS an `Outcome` — `passed`, `findings`, or `not-run` — and a single printer
243
- renders all of them, groups the skips by reason, and computes the exit code. Previously each
244
- check printed its own `✓` inside the `if` that held its data, with a `skipped[]` array and a
245
- `skipReasons` Map maintained alongside; it was correct because someone was careful, and the
246
- next check added was one `if` away from lying again.
247
-
248
- It had lied twice, in the same shape: the KB-dependent block once printed ONE `✓` above six
249
- checks whose own `✓`s lived inside their `if`s (so a run with no pulled KB read as "one check,
250
- passed", and an entire backlog batch reached production that way), and `yamlDocs()` once
251
- dropped an unparseable file so `validate` printed all-green over a pack the platform's importer
252
- then refused. **An unparseable file is not "no findings", it is "no idea", and those must never
253
- print the same** — a check that returns nothing now cannot reach the `passed` branch at all.
254
-
255
- Output is unchanged for a normal run. `passed` carries its own line, so the reserved-entity
256
- check keeps the narrower wording it uses when the catalog rules are absent from an older pull.
257
- `--require-kb` is now one line over the returned skip list.
258
-
259
- Verified 2026-09-04: all 23 marketplace packs exit 0 with no findings; a pack with no pulled KB
260
- prints zero `✓` for the six KB-dependent checks plus one grouped ⚠ naming all six, and
261
- `--require-kb` exits 1; a duplicate YAML key still exits 1 naming the file.
262
-
263
- ## [0.8.5] - 2026-09-02
264
-
265
- ### Added
266
- - **`octwin work --unrouted`** — the inbox filtered to items in NO queue. The route has always
267
- supported the filter; the CLI never passed it, so `--queues` could tell you a count and not
268
- show you the items behind it.
269
-
270
- ### Changed
271
- - **`octwin work --queues` leads with the unrouted count.** It was already printed, as
272
- `(unrouted: N open)` tucked under the queue list. A routed item sits in a list someone works;
273
- an unrouted one sits in nobody's, so it is the only line on that screen that means "these are
274
- lost". It is now a warning block that names the likely cause and points at `--unrouted`. Still
275
- silent at zero — a clean project stays quiet, or the warning stops meaning anything.
276
-
277
- ## [0.8.4] - 2026-09-02
278
-
279
- ### Fixed
280
- - **A deploy whose seed failed still led with `✓ Deployed`.** The step errors were never
281
- missing — `readDeployProgress` has collected every `status:'error'` frame into `stepErrors`
282
- since 0.1.14, printed them, and exited non-zero. They were printed *after* `printDeploySuccess`,
283
- so the first and largest line said `✓ Deployed` and the ⚠ came underneath. A pack author
284
- reported their deploy as a clean success while its demo seed had failed; they were reading the
285
- transcript exactly as written. The count now goes INTO the headline, which reads
286
- `⚠ Deployed <id>@<v> onto <target> WITH n failure(s) — data may be incomplete`. `octwin seed`
287
- gets the same treatment. *A signal that arrives after the verdict is not a signal.*
288
- - **The non-streaming deploy and seed paths had no step-error check at all.** With no SSE frames
289
- to read, a failed seed printed a clean `✓` on that path even after the streaming one was fixed
290
- in 0.1.14. Both now read `seed_failed` from the response body (new in the platform alongside
291
- this release), print each failed kind with its reason, and exit non-zero.
292
- - **A partial demo seed is now reported as partial.** The platform no longer abandons the rest of
293
- the seed when one demo row throws, so `Seeded:` gains an `n row(s) FAILED` part — without it a
294
- partial seed reads as a complete one that simply had fewer records than the author wrote.
295
-
296
- ## [0.8.3] - 2026-09-02
297
-
298
- ### Fixed
299
- - **`validate` printed all-green over a pack the platform could not import.** Every YAML file was
300
- parsed inside a `try { … } catch { return [] }`, so a file that failed to parse was silently
301
- DROPPED from the list and every later check skipped it. The `catch` was justified in a comment —
302
- "a syntax error is the structural gate's to report" — and that was not true: the structural gate
303
- (`validatePackBundle`) checks paths, extensions and traversal, and never parses YAML.
304
-
305
- Measured 2026-09-02: a duplicate `s_header:` key in a locale file passed `octwin validate` twice
306
- and was then refused by the platform importer with `Map keys must be unique at line 24,
307
- column 3` — the same message, from the same `yaml` version the CLI already had. The author's only
308
- clue was a red box in the console naming no file.
309
-
310
- YAML syntax is now its own announced gate that FAILS: it names each unparseable file with the
311
- parser's own message and exits non-zero, before any check reads a document. An unparseable file is
312
- not "no findings", it is "no idea", and the two must never print the same.
313
-
314
- - **Three more readers that turned "I could not read this" into a normal answer.** Swept every
315
- discarding `catch` in the CLI after the above; three collapsed a real fault into an ordinary state:
316
- - `readCreds` returned `{}` for a CORRUPT `credentials.json` as well as an absent one, so a token
317
- the author knows they saved simply stopped being found and the advice was "log in" with no
318
- mention of why. Now names the file and the parse error, once per process (it has three call
319
- sites and one broken file is one problem).
320
- - `readLocalKb` returned null for a half-written `.octwin/platform-kb/index.json` as well as a
321
- never-pulled one — so an interrupted pull read as "you have not pulled yet" and the author
322
- re-ran the command that left it that way. [`kb-path.ts`](src/lib/kb-path.ts) states this rule
323
- for the DIRECTORY lookup; the index read beside it kept collapsing anyway. It now says which.
324
- - The deploy progress stream discarded unparseable SSE frames silently. Skipping one is right;
325
- skipping ALL of them left `terminal: null`, reported as "the stream ended without a terminal
326
- event" — true, and indistinguishable from a dropped connection. The count is now named when
327
- (and only when) no terminal frame arrived, pointing at a CLI older than its platform.
328
-
329
- The other five discarding catches were read and LEFT: each returns a documented fallback for a
330
- state that is genuinely ordinary (no update-check network, a heartbeat SSE frame with no `data:`).
331
- `scripts/` was swept too and is clean by design — `kb-dataflow.mjs` skips a fence it cannot parse,
332
- and `check-kb-examples.mjs` holds a non-vacuity FLOOR of 130 parsed fences so the skip cannot go
333
- quiet. That is the better pattern where a skip is legitimate.
334
-
335
- ## [0.8.1] - 2026-08-27
336
-
337
- ### Fixed
338
- - **Logging in made `platform-kb pull` WORSE.** The command preferred the tenant-scoped route
339
- whenever a token was saved, and that route is guarded by `pack:deploy` — so a developer holding a
340
- token without that scope got a **403 on a pull that succeeds with no token at all**. It is the
341
- likeliest token a new developer holds: no console preset could even reach `pack:deploy` before
342
- 2026-08-26. `platform-kb` now always uses the anonymous route and never sends a credential.
343
- `--token` is accepted and ignored so existing scripts keep working.
344
-
345
- The platform serves the *same* bundle from all three of its views — its route file states the
346
- payload is identical and tenant-independent — so the authed route returned nothing extra and the
347
- credential could only ever subtract. The two reasons the old code gave did not survive checking:
348
- "keeps the author's own instance the source of truth" is vacuous (both routes are the same
349
- instance), and "works against platforms that predate the public rung" is a backward-compatibility
350
- shim this codebase does not carry.
351
- - **The drift nudge now works without a token.** It polled through the same authed route, so an
352
- author inspecting data with a narrow token was told, every time, that it *could not* check —
353
- advice in place of the signal. Both the poll and the apology are gone: the poll is anonymous, so
354
- it simply works.
355
-
356
- ## [0.8.0] - 2026-08-27
357
-
358
- ### Added
359
- - **Five new command families, closing the gap between what a token reaches and what the CLI can
360
- ask.** A **Full CLI access** token spans the whole scope registry, and four of those domains had
361
- no command at all — so the reach existed and there was nothing to type.
362
- - `octwin automation [campaigns]` — every job the pack's declaration produced, with status,
363
- interval and last result (matched / acted / errors), under a health line whose counts come from
364
- SQL rather than from filtering the page (the job list is capped server-side, so a client-side
365
- count would depend on the cap). Writes: `run` · `pause` · `resume` · `send <campaignId>`.
366
- - `octwin integrations` — what the pack **declares** beside what is actually **configured**, in
367
- one view, because a connection declared and never configured is the commonest reason an
368
- integration silently never fires and neither list alone can show it. Plus
369
- `preflight <key>` (diagnosis, no outbound call, `integrations:read`), `test <key>` (a live call,
370
- `integrations:write`, exits 1 on failure), `deliveries [id]`, `retry|cancel|send-now <id>`,
371
- and `events` for what arrived inbound.
372
- - `octwin journeys [id] [--funnel|--overview|--goals|--trends|--cost|--definition] [--stage <id>]`
373
- — the declared journeys, measured. Same flag grammar as `octwin analytics` on purpose: a journey
374
- funnel and an entity funnel are the same question about different subjects. `--definition` is
375
- the one view that works with no traffic.
376
- - `octwin performance [--detail]` — the project's business indicators, each with its delta against
377
- the previous window and the `why` naming the declaration it came from. Needs `records:read`, not
378
- a `performance:*` scope (there is none), so a read-only token already reaches it.
379
- - `octwin usage` — model calls, tokens and cost, by model / kind / agent / channel; project when
380
- one is pinned, workspace otherwise. Needs no particular scope. **Model spend only** —
381
- WhatsApp/Meta message billing is operator-only and outside the token scope registry, which the
382
- output says rather than leaving as an absence.
383
- - **`octwin automation run|pause|resume|send` accept the declaration KEY.** The routes take a UUID
384
- and answer a bare *"Malformed identifier in the URL"* 400 for anything else — but the key
385
- (`cart_recovery_nudge`) is what the list prints and what the author wrote in their own YAML. The
386
- key is now resolved against the list route, and an unknown one fails naming the keys that exist.
387
-
388
- ### Fixed
389
- - **A body-less write sent `content-type: application/json` and no body, so Fastify answered a bare
390
- `400 Bad Request`.** `apiSend` set the header unconditionally; every caller until now passed an
391
- object, so the branch was dead and the bug latent. The first body-less POST (`automation run`) hit
392
- it immediately. The header is now omitted when there is no body — rather than each caller learning
393
- to pass `{}`, which is the per-site divergence that helper exists to prevent.
394
- - **Four URLs were exempt from the route guard.** `cli-routes.test.ts` reads a template literal in
395
- the first argument position, so `apiGet(base, t)` — a bare identifier — was never checked. That
396
- covered the `scheduling` engine-state and `agents` roster calls, and would have covered the new
397
- `journeys`, `performance` and `usage` ones. All now spelled as literals: the guard checks **62**
398
- URLs, up from 45.
399
-
400
- ## [0.7.3] - 2026-08-26
401
-
402
- ### Changed
403
- - **A marketplace listing request is now OPT-IN: `octwin deploy --request-listing`.** A plain
404
- `octwin deploy` says nothing about the public marketplace — it neither asks for a listing nor
405
- gives one up. `--withdraw-listing` retracts, including an approved listing.
406
- **Why:** the request was read from the manifest's `listing.public` on every deploy, and deploying
407
- is how you *test*. 17 of the 23 published packs carry that key, so an edit-deploy-chat loop filed
408
- a review request every time round. Worse, the *absence* of the key meant **retract** — so an
409
- ordinary deploy of a pack whose manifest you had not yet annotated could wipe a listing you
410
- already had. `--request-listing` still requires `listing.public: true` in the manifest (the
411
- manifest states that the pack is a product; the flag is you choosing to ask), and the flag
412
- without the key is a clean error rather than a silent no-op.
413
- - **The listing verdict distinguishes "you submitted this" from "your approval expired".** They are
414
- both `pending` and they mean opposite things to an author. A deploy that changes the content of an
415
- approved pack now says so in those words — an approval covers only the content it was made
416
- against, so it cannot survive an edit.
417
-
418
- ### Added
419
- - **A one-line nudge when your manifest asks and your deploy did not.** A pack carrying
420
- `listing.public: true` that has never been submitted now prints the flag to use, so an opt-in
421
- default cannot turn into waiting for a review nobody requested.
422
-
423
- ### Fixed
424
- - **The "newer CLI" and "KB drifted" notices now print when a command FAILS.** All three nudges
425
- (CLI upgrade · KB drift · unread memos) were awaited at the very end of `main()`, which silently
426
- meant *only on success* — `die()` is a hard exit, so a failed deploy, an auth error or a bad
427
- manifest printed none of them. That is backwards: a stale capability reference is a leading cause
428
- of the failure an author is staring at, so the run that most needed the nudge was the only one
429
- that never got it. They are now computed before the command and printed however it ends.
430
- - **The CLI-upgrade notice is no longer hidden from piped output.** It began with
431
- `if (!process.stdout.isTTY) return`, so every agent-driven and CI run — the readers that cannot
432
- notice an outdated CLI on their own — was the one audience never told. Its two siblings had
433
- already dropped that gate for exactly this reason; now all three agree. Still skipped under
434
- `npx`, where there is nothing to upgrade.
435
- - **`octwin login` now reports KB drift too.** It is networked and usually the first command of a
436
- session, i.e. the best possible moment to say the reference moved, and it was excluded.
437
- - **A memo poll can no longer fail the command it was annotating.** It went through `apiGet` →
438
- `fetchOrDie`, whose job is to `die` on a network failure — so an unreachable platform turned an
439
- observer into a command failure. It now uses a plain, timed, fail-silent fetch.
440
- - **A failing command reports its real exit code again on Windows.** Moving the polls before the
441
- command made `process.exit()` abort with `Assertion failed: !(handle->flags & UV_HANDLE_CLOSING)`
442
- and return **127** instead of 1 — so CI saw neither success nor the documented failure code. The
443
- CLI now unwinds through a `CliExit` and lets the event loop drain, which is the only teardown
444
- that is clean once the polls have opened sockets. `--check`'s exit 2 and the streaming commands
445
- were re-verified.
446
-
447
- ## [0.7.2] - 2026-08-20
448
-
449
- ### Fixed
450
- - **`octwin feedback` now tells you what is already waiting, on stdout.** It discarded the submit
451
- response entirely — destructuring `{ status, json }`, checking the status and never reading the
452
- body — then printed *"a reply arrives as a memo, this CLI will tell you when one is waiting"*. The
453
- platform started returning the unread counts on that response (2026-08-20), so the answer was
454
- there to print and was being thrown away.
455
- **Why it matters more than it sounds:** `notifyIfMemosWaiting` already covers this command and was
456
- firing correctly — but it writes to **stderr**, and the authors driving this CLI are agents reading
457
- stdout. The one signal that mattered was addressed to a channel nobody was listening on. On
458
- 2026-08-19 an author submitted two reports two hours after three replies were published and
459
- re-reported five findings those replies had already closed. Now the count prints in the same block
460
- as the acknowledgement, naming the command, and says outright when a reply may already answer what
461
- you just sent. Against an older platform the field is absent and the previous line stands.
462
-
463
- ## [0.7.1] - 2026-08-19
464
-
465
- ### Fixed
466
- - **`work decide` now says when an action moves nothing.** `to_stage` is optional — an action may
467
- record a decision without a transition — but both outputs communicated that by omission: `--dry-run`
468
- left `to_stage: null` sitting among twenty other keys, and a real apply printed a bare
469
- `✓ Applied '<action>'`. An author read both, shipped `request_more_info` with no `to_stage`, and
470
- lost the `awaiting_customer` their whole customer-reply capture branched on — their words: *"Nothing
471
- about this failed loudly; it just quietly never did the one thing the whole feature depends on."*
472
- The preview now states `→ does NOT change the status (this action only records a decision)` and the
473
- apply says `status unchanged (the action declares no to_stage)`. The console's decision panel got the
474
- same sentence in the same change.
475
-
476
- ## [0.7.0] - 2026-08-18
477
-
478
- ### Added
479
- - **`octwin memos` — the channel answers now.** `octwin feedback` was one-way: an author reported and
480
- heard nothing, ever. Two kinds arrive here, both printed in full — a **reply** to a report you sent,
481
- and a **notice** published to every author (a new capability, a deprecation, a breaking change) —
482
- each carrying `info` / `action_required` / `breaking`. Reading marks them read; `--all` re-reads
483
- history and acks nothing (also the escape hatch if a piped `--json` consumer died halfway).
484
- - **Every networked command now says when a memo is waiting**, one line to stderr, always naming the
485
- command to run. It rides work that was already networked, never throws, and is **deliberately not
486
- TTY-gated** — the same reasoning as the KB drift nudge, whose docblock says it plainly: the primary
487
- reader of this CLI is an authoring agent whose output is piped, and gating on `isTTY` means the one
488
- reader that cannot notice on its own is the only one never told. Unlike that check there is no local
489
- marker file: read state is per-workspace on the platform, so an agent in a fresh container still
490
- learns about an unread reply.
491
-
492
- Why it matters, measured: in August 2026 four reports sat unread for nine days, and one author
493
- replaced every `$t()` call with hardcoded English across all 16 flows of a production pack to work
494
- around a bug that had been fixed two days earlier. Nothing could tell them.
495
-
496
- ## [0.6.1] - 2026-08-18
497
-
498
- ### Fixed
499
- - **`octwin status` worked for no pack at all, and had not since 2026-08-01.** It sent the manifest's
500
- **bare** id (`clinic`) to a route that requires the qualified `<owner>.<name>` — and a manifest
501
- cannot legally declare the qualified form, because the owner segment is attached at publish time
502
- from the authenticated publisher (both the platform and this CLI reject a `.` in it). So the route
503
- answered 404 for every pack, every time. It now resolves the owner from `whoami`'s `tenant_slug`,
504
- and takes an explicit `octwin status <packId>` when you already know it (from `octwin agents` or
505
- `octwin projects`, both of which print qualified ids). Reported by two pack authors, who lost time
506
- to a command that said their pack was missing seconds after a deploy the platform had accepted.
507
- - **A 404 from `octwin status` no longer always reads "not installed".** That one branch covered four
508
- different failures — a malformed pack id, an unknown tenant, an unknown/pinned-elsewhere project,
509
- and the genuine no-active-install — so the message named the *least* likely cause and sent an author
510
- chasing a deploy that had already succeeded. The route says which; the CLI now relays it, and adds
511
- the "run `octwin deploy` first" hint only to the case it fits.
512
- - **`octwin logs` always reported "No conversations"**, including immediately after an `octwin chat`
513
- that had plainly worked. It read `conversations` off the response; the platform moved that endpoint
514
- to the shared page envelope on 2026-08-09 and answers `rows`, which every other list command here
515
- already reads. Both authors filed this as replica lag or a cache gap — nothing lagged, the payload
516
- was simply never read. `octwin logs <conversationId>` was unaffected.
517
-
518
- ## [0.6.0] - 2026-08-09
519
-
520
- ### Changed
521
- - **`octwin cases` is now `octwin work`, and it works again.** The platform's work-inbox
522
- consolidation (2026-08-08) replaced the case-only surface with `/work` over every entity a pack
523
- declares worked, and renamed the scopes to `work:read`/`work:write` — which left every `octwin
524
- cases` call a silent 404 in a published CLI. The command family is renamed to match the platform:
525
- `octwin work [recordId] [--queues]`, with writes `assign` / `note` / `decide` (the declared
526
- operator actions, `--dry-run` previews) and `stage <id> --to <s>` riding the one platform-wide
527
- stage verb (`POST …/xrm/records/:id/stage`, needs `records:write`). `transition` is gone with the
528
- route it called.
529
- - **`octwin orders transition` rides the same stage verb.** `POST …/orders/:ref/transition` was
530
- retired server-side in the same consolidation; the CLI now resolves the order's record id from the
531
- detail read and moves the stage through `…/xrm/records/:id/stage` (scope: `records:write`).
532
-
533
- ### Added
534
- - **A route guard so this cannot rot silently again**: `src/lib/cli-routes.test.ts` extracts every
535
- `/api/self/**` URL the CLI builds and asserts it (method included) against the platform's dumped
536
- route table — the gap that let both breakages above ship.
537
-
538
- ## [0.5.1] - 2026-08-01
539
-
540
- ### Fixed
541
- - **`validate --remote` blamed the platform's version for a bad `--project`.** Every 404 from
542
- `POST /api/self/p/packs/validate` printed *"this platform has no /packs/validate endpoint yet
543
- (older version)"*. That was accurate when the route resolved nothing, but it now resolves the
544
- tenant and project **before** validating — and an unknown project, or one outside a token's pin,
545
- answers 404 by design. So a typo in `--project` sent you looking for a version mismatch instead of
546
- at the flag. The two cases are now told apart by the response **body**, not the status: a missing
547
- route is Fastify's `error: 'Not Found'` and keeps the old wording, while the platform's own
548
- `project '<slug>' not found under tenant` is printed as-is, with the flags to check.
549
-
550
- ## [0.5.0] - 2026-08-01
551
-
552
- ### Added
553
- - **`octwin seed [--pack <packId>]`** — apply the pack's demo/reference data to the project it is
554
- installed on, without redeploying: `xrm.yaml` `demo:` records + scheduling availability, the
555
- commerce catalog, and the demo operator topology. Reports what **each kind** produced.
556
- Previously seeding was reachable only as `deploy --seed`, because the platform's seed endpoint was
557
- keyed on an install id, guarded platform-admin, and carried no tenant/project segments — so the
558
- `/api/self/**` surface could not reach it and a `pack:deploy` token never could. Re-seeding meant
559
- a full redeploy or asking an operator. Idempotent and cheap to re-run: records upsert, and
560
- existing media is REUSED rather than regenerated, so a second pass reports zero images.
561
-
562
- ## [0.4.0] - 2026-08-01
563
-
564
- ### Added
565
- - **`octwin projects create` / `octwin projects rm`** — a **disposable end-to-end environment** from
566
- the CLI, which is what marketplace developers have been missing. `octwin deploy` has always needed
567
- a project that already existed and the CLI could only *list* them, so standing up a throwaway
568
- full deployment meant opening the console or asking an operator. Now:
569
- ```bash
570
- octwin projects create "Scratch" # → slug `scratch`
571
- octwin deploy --project scratch --seed # publish + install + demo data
572
- octwin chat "hi" --project scratch # talk to it (--script for a whole conversation)
573
- octwin projects rm scratch --yes # throw it away
574
- ```
575
- A throwaway environment is deliberately **not a special kind of thing** — it is an ordinary
576
- project in your own workspace, so it inherits your plan, entitlements, RBAC and teardown with no
577
- separate lifecycle. `create` derives the URL slug from the name (`--slug` pins one, `--pack`
578
- installs an already-published pack). `rm` is a HARD delete — the project and everything cascading
579
- from it, no undo, not the same as archiving — so **without `--yes` it only prints what would be
580
- destroyed**, making the dry run the default; the impact list is derived from `pg_constraint`, the
581
- same payload the console's confirm dialog renders. Both need `projects:write`, which a
582
- `pack:deploy` token does **not** confer — the CLI names that scope in the 403 hint.
583
-
584
- ## [0.3.0] - 2026-07-31
585
-
586
- ### Added
587
- - **`octwin projects`** — the `--project <slug>` values your token can actually name, with the plan's
588
- project cap. Every project-scoped command takes that flag and nothing printed the list, so an
589
- author whose token was not pinned had to guess, and a wrong guess 404s identically to a project
590
- that exists but has no install. `--archived` includes archived projects; `--json` for raw.
591
- A `pack:deploy` token reaches it: the platform route was widened to accept `pack:deploy` alongside
592
- `projects:read`, because `pack:deploy` is `access: 'special'` and confers nothing else — the
593
- command would have 403ed for exactly the person it exists for.
594
- - **`octwin validate --require-kb`** — turn a skipped KB-driven check into a failure, for CI.
595
-
596
- ### Fixed
597
- - **`octwin validate` printed ✓ with two of its three checks switched off.** The render-intent and
598
- primitive-argument checks read `<packDir>/.octwin/platform-kb/`, joined onto the pack directory
599
- EXACTLY — so an author who pulled once at a repo root and then worked in `packs/<name>/` had both
600
- checks silently disabled, and the ✓ printed above them unconditionally while the per-check ✓s lived
601
- inside the `if`s. An entire batch of platform-backlog entries reached production through that hole.
602
- Three fixes: the KB is now found by **walking up** (one pull at a repo root covers every pack under
603
- it, `src/lib/kb-path.ts`); the readers report **three states** — absent, malformed, ok — so a
604
- half-written pull no longer reads as "you haven't pulled yet"; and a skip is **announced on the
605
- last line printed**, because a caveat above a ✓ does not reach a reader who stopped at the ✓.
606
- Warn-and-exit-0 stays the default (the KB is a gitignored cache and `platform-kb pull` needs
607
- `pack:deploy`, so a hard failure would break a fresh clone) — the defect was the silence, not the skip.
608
- - **`octwin status` said "live and current" for a pack that could not receive a message.** Every field
609
- it printed was process-global: `registered` is true for a pack ANY project on that instance loaded.
610
- Dispatch is per-project and takes the oldest ACTIVE install, ignoring the rest. The route now
611
- filters `status = 'active'` (an archived install used to report live) and compares against the real
612
- dispatch target, so status can say plainly that another pack owns this project's messages.
613
- - **`octwin validate --remote --project does-not-exist` answered `{ ok: true }`** while `deploy` with
614
- the same flag 404ed. The platform route resolves tenant and project before validating now.
615
-
616
- ### Changed
617
- - **`octwin validate --remote` also runs the platform's flow LINT.** It used to run only at pack load,
618
- so a finding of severity `error` — an `assign:` whose value is a quoted literal, a `$t()` key with
619
- no namespace — passed validate and failed the deploy. Offline `validate` cannot do this: the lint
620
- needs a template-expanded `FlowDef`, which only the server builds.
621
- - **`record_aggregate` / `record_group` now REQUIRE a scope** (`contact_id` or `all: true`) — a
622
- platform contract change the offline arg check replays from the KB. Re-pull after upgrading.
623
-
624
- ## [0.2.0] - 2026-07-30
625
-
626
- ### Fixed
627
- - **`records`, `cases`, `orders` and `catalog` printed a correct total and ZERO rows.** The platform
628
- collapsed its eight per-domain list envelopes into one `Page<T>` whose collection key is `rows`;
629
- the CLI still read `json.records` / `.cases` / `.orders` / `.products` behind a `?? []`, so the
630
- fallback turned a key rename into an empty list instead of an error. `octwin records doctor`
631
- reported *"5 record(s)"* and then *"(none — mint a `records:read` token …)"*, blaming the user's
632
- credentials. All five readers now go through one `readPage` helper
633
- (`src/lib/page.ts`) with a test pinned to the real envelope — a hand-copied key name in an
634
- untested CLI is what shipped this, so the fix is the single reader, not five edits.
635
- - **`--flag=value` silently did nothing.** `--limit=5` became the key `limit=5` and the command ran
636
- with its default. Now parsed; `--set`/`--param` also accept repetition.
637
- - **`octwin catalog` always printed `Products: 0`** — it counted the page, and the route's `total`
638
- had never been read.
639
-
640
- ### Added
641
- - **Write commands — a pack author can now exercise the state their pack creates, not just read it.**
642
- Every one needs the matching `:write` scope; a leading verb (`create`/`note`/`transition`/…) is
643
- what distinguishes a write from the read that shares its command.
644
- - `records create|patch|stage|note`, `records tasks`, `records task complete`
645
- - `cases assign|note|transition|decide` — `decide --dry-run` previews the customer-facing copy and
646
- resulting status **without committing** (that route needs only `cases:read`)
647
- - `orders transition|refund` · `catalog availability|stock` · `agents set`
648
- - `scheduling rules|rule add|rule rm|exception add|exception rm`
649
- - **`octwin feedback`** submits the pack's `FEEDBACK.md` to the platform team, attaching the pack
650
- version, this CLI's version and the `content_hash` of the capability reference you pulled — the two
651
- facts that separate a real platform gap from something already fixed or a stale KB. Replaces
652
- "hand the file to the platform team".
653
- - **`--offset` on every list**, and a line saying when a list was truncated and what to run next.
654
- `has_more` was on every response and no command surfaced it, so a partial list looked complete.
655
-
656
- ### Changed
657
- - `orders refund` **exits non-zero when the payment gateway refuses.** The route answers `200` with
658
- the verdict in `gateway`, so reporting the HTTP status would tell an operator money moved when it
659
- did not.
660
- - A 403 on a record or case write now says it may be an **RBAC grant gap** rather than a missing
661
- scope: the scope is checked on the token, then the verb is re-checked against that specific row.
662
-
663
- ## [0.1.21] - 2026-07-30
664
-
665
- > **Never published to npm.** Bumped in-repo, then superseded hours later by 0.2.0 — everything
666
- > below ships as part of that release. Kept as its own section because the changes are distinct.
667
-
668
- ### Added
669
- - **`deploy` and `status` report the marketplace-listing verdict.** A manifest carrying
670
- `listing.public: true` put the pack into an operator review queue, and the state existed only in
671
- the console — so an author working from the CLI got no acknowledgement that the request had
672
- registered, and never saw a rejection note (which the platform *requires* precisely because it is
673
- their only feedback). Both commands now print it via `printPublicListing`, and stay silent for a
674
- pack that never asked. `status` also distinguishes *approved* from *actually public*: an approval
675
- pins the content sha it reviewed, so any edit returns the pack to the queue on its own.
676
- - **`octwin pull` is discoverable.** It was implemented and answered `--help`, but appeared in
677
- neither `octwin help` nor the README — the one command that recovers a deployed pack's only source
678
- copy was invisible unless you already knew its name. Also added to the scope-requirement table, so
679
- a 403 names `pack:deploy` instead of printing the generic hint.
680
-
681
- ### Fixed
682
- - **The capability-reference drift check no longer fails silently on a narrow token.** The `?meta=1`
683
- poll needs `pack:deploy`, but it rides on every networked command — so an author inspecting data
684
- with a `records:read`-only token got no drift signal at all, and a stale reference is exactly what
685
- leads to inventing a primitive from memory. A 401/403 there now says so once.
686
- - **README: casework is declared in `worklist.yaml`, not a `cases.yaml`.** That grammar was retired;
687
- following the README produced a pack whose casework silently never loaded. `octwin media generate`
688
- was also missing from the command table.
689
- - **`records` no longer blames the plan for a route the plan does not gate.** `GET /xrm/entities`
690
- carries only the scope guard, so a 403 on the entity list wrongly cited the `records` plan feature.
691
-
692
- ### Removed
693
- - **Unreachable rename branches in `init`.** The agent-id and `main`-flow renames sat behind
694
- `--agent` / `--flow` options the CLI never parsed, against a template that ships no `main` flow —
695
- both branches could never fire, and their patterns would have matched nothing if they had.
696
-
697
- ## [0.1.20] - 2026-07-29
698
-
699
- ### Added
700
- - **`octwin validate` catches primitive arguments the platform would drop — offline, no token.** A
701
- primitive takes the arguments it declares and silently ignored the rest, so an invented or
702
- misspelled `args:` key deployed clean, ran clean, and simply did nothing: `record_list args: {
703
- order: … }` (the argument is `sort`) never ordered, and `booking_cancel args: { booking_record_id:
704
- … }` meant the REQUIRED `record_id` never arrived, so cancelling just failed. Validate now replays
705
- the platform's contract from the pulled KB (`primitives/*.json` → `inputSchema`) and names the bad
706
- argument, what the primitive takes, and any required argument that is missing. Scanning the 21
707
- shipped marketplace packs found **ten** such errors across five packs. Keys are checked, values are
708
- not — an `args:` value is normally an expression string resolved at runtime.
709
- [`args-check.ts`](src/lib/args-check.ts).
710
- - Silently skipped when the KB has not been pulled yet, like the render-intent check beside it.
711
- - It cannot see inside a `use:` template body (expanding one is the platform's job) — `octwin
712
- validate --remote` covers that case, and now also reports unreachable `$bind.<path>` reads and
713
- `outputs:` port typos, which have no offline equivalent.
714
-
715
- ## [0.1.19] - 2026-07-29
716
-
717
- ### Added
718
- - **`octwin validate` catches render-intent fields the platform would drop — offline, no token.** Each
719
- render intent takes a fixed field set; a key outside it used to be swallowed at load and dropped at
720
- render, with no error anywhere — just a card missing what the author wrote. Validate now replays the
721
- platform's own contract from the pulled KB (`render-intents/*.json` → `allowed_keys`) and names the
722
- bad field, the intent, and what is allowed. Scanning the 21 shipped marketplace packs found two real
723
- instances in 223 intents: a `text_card` carrying `buttons` (the fallback's only escape button never
724
- rendered) and a `list_picker` carrying a non-existent `group_by` (a whole mapper step feeding a
725
- fabricated parameter). Silently skipped when the KB has not been pulled yet.
726
-
727
- ### Changed
728
- - **`octwin platform-kb pull` now explodes the reference and writes an `INDEX.md`.** A pull used to
729
- write ~787 KB across 34 flat files — about 225k tokens, more than the pack being authored — so
730
- finding one primitive meant reading a 122 KB catalog. Catalogs the platform describes as
731
- enumerable are now written **one file per entry** (`primitives/record_list.json`,
732
- `render-intents/carousel.json`, `declarations/xrm.json`, …), with `INDEX.md` mapping every doc and
733
- all 171 entries to its file with a one-line summary. Reading one primitive went from ~38k tokens to
734
- ~700. The layout comes from the platform (an `entries` descriptor on the bundle index) rather than
735
- being hardcoded here, so this CLI keeps working against any platform version and a platform that
736
- adds a catalog needs no CLI release. The pulled directory is cleared each pull, so a withdrawn
737
- capability cannot linger as a file the authoring agent reads as current — its *contents* are
738
- cleared rather than the directory itself, since on Windows a directory that is any shell's working
739
- directory cannot be removed.
740
-
741
- ## [0.1.18] - 2026-07-29
742
-
743
- ### Fixed
744
- - **The bundle collector and the platform's repo import disagreed about what a pack directory
745
- contains.** `collectBundleFiles` had its own rule and kept three things the operator's GitHub
746
- import drops: `*.ts`/`*.tsx`, `__snapshots__/` and `*.example`. Because the server rejects a
747
- `.ts` outright, the same directory imported cleanly from GitHub and failed to deploy from
748
- disk with `'…': executable code is not allowed` — an error blaming a file that was never
749
- meant to ship (a snapshot test beside a flow, or the documented `xrm.yaml.example` template).
750
- The rule now lives in a vendored `lib/pack-source.ts` beside the vendored validator, and a
751
- parity test in the platform drives both copies over one table.
752
-
753
- ### Removed
754
- - **`pack.json` is gone — the saved login IS the deploy target.** The file had eroded to a single
755
- field, `platform_url`, which `octwin login --url … --token …` already states; `tenant`/`project`
756
- became optional overrides once deploy tokens started carrying their own tenant and project pin.
757
- So it was a second home for a fact `login` knew, and it cost real things: a machine-specific file
758
- committed into every pack repo, a four-link config-precedence chain to document, and an
759
- exclusion rule duplicated in the bundler and the server (which had already drifted apart).
760
- `octwin init` and `octwin pull` no longer write one, and nothing reads one. **A pack directory is
761
- now pack content and nothing else** — the same repo deploys from any machine, and a pulled pack
762
- redeploys with no flags.
763
-
764
- ### Changed
765
- - **`octwin login` now sets the default deploy target**, not just the token: it writes a
766
- `default_url` key alongside the token in `~/.octwin/credentials.json`. Every command resolves
767
- **flags → env (`PACK_PLATFORM_URL`/`PACK_TENANT`/`PACK_PROJECT`/`PACK_TOKEN`) → saved login**.
768
- An existing credentials file simply has no `default_url` until the next `octwin login` — which is
769
- exactly what the "no platform url" error now tells you to run. CI is unaffected (it passes
770
- `PACK_PLATFORM_URL` + `PACK_TOKEN` as env and never had a `pack.json` — that file is retired).
771
-
772
- ## [0.1.17] - 2026-07-27
773
-
774
- ### Added
775
- - **`octwin pull <packId>` — write a DEPLOYED pack's source back to disk.** The inverse of
776
- `deploy`. A pack pushed with the CLI lived on the platform as an artifact the runtime served
777
- but nothing could hand back, so its only source copy was the machine that pushed it. Pull it,
778
- fix it, redeploy it. Writes a `pack.json` (retired in 0.1.18 — the saved login is now the
779
- target) so the pulled directory redeploys where it came from; `--version` picks a version,
780
- `--force` overwrites a non-empty dir. You may pull a pack
781
- your tenant OWNS (an operator token pulls any) — a pack you merely installed is not yours to
782
- read.
783
- - **`octwin chat --script <file>` — drive a whole conversation from one invocation.** One turn per
784
- line, in order, in a single process over a single SSE connection, waiting for each turn to settle
785
- before sending the next. Blank lines and `#` comments are skipped; `tap:<id>` presses a rendered
786
- row/button (the rest of the line is kept verbatim, since a tap id is itself colon-delimited),
787
- `media:<path>` uploads a file, and `media:<path> | caption` attaches one.
788
-
789
- This exists because **chaining invocations races the agent loop.** A turn ends on a quiet gap
790
- (`TURN_SETTLE_MS`), which can arrive while the server-side loop is still running — so
791
- `chat A && chat B` lets B's inbound land mid-turn, and the agent fills required fields with
792
- placeholder text (`service_id: "service-id"`) or starts a second workflow run. Those look exactly
793
- like flow bugs and cost a field author three separate investigations. The one-turn-per-invocation
794
- rule is now stated in `chat --help` and the header usage as well.
795
-
796
- ### Changed
797
- - **`octwin deploy` reports the suspended runs it invalidated.** A redeploy rebuilds the pack's
798
- tools, and in-flight flow runs live in those tools — so every suspended conversation is dropped.
799
- The deploy prints `ⓘ N suspended run(s) invalidated` when N > 0, instead of leaving the author to
800
- discover it as a `workflow_resume_stale` on the next tap.
801
-
802
- ## [0.1.16] - 2026-07-26
803
-
804
- ### Added
805
- - **A pack can ship committed images.** `jpg`/`jpeg`/`png`/`webp`/`gif`/`pdf` files in your pack
806
- directory now travel as a separate `blobs` half of the bundle (base64 on the wire, `bytea` in
807
- storage) instead of being rejected as "not an allowed pack file type". Declare each one under the
808
- manifest's `static_assets: [{ file, key }]` and reference it from `config:` with the
809
- `$pack_asset:<key>` sentinel — the platform uploads it to the media system at install and the
810
- sentinel resolves to the served URL. `octwin validate` reports the image count alongside the file
811
- count.
812
- - **The size ceilings fail locally, before upload** — 2 MB per file, 32 MB of binary per pack,
813
- mirroring the server. `svg` stays rejected: it is script-capable and these assets are served to
814
- browsers.
815
-
816
- ### Fixed
817
- - **Committed images were silently corrupted.** `collectBundleFiles` read *every* file with
818
- `readFileSync(full, 'utf8')`, so a JPEG went through a lossy UTF-8 decode and arrived mangled
819
- server-side — a deploy that "succeeded" and rendered a broken image. Binary files now split off
820
- into `blobs` and keep their bytes.
821
- - **`octwin status` reported `loaded=(none)` for every pack, always.** It printed a `loaded_version`
822
- field that stopped existing when reload moved to content-sha keying, which also meant the
823
- version-drift warning underneath it could never fire. It now prints the **content sha** the
824
- instance has loaded and the one the catalog holds (with the artifact's `origin`), and warns off the
825
- platform's own `up_to_date` flag. The sha is the more useful fact anyway: re-publishing the *same*
826
- version changes it, which is exactly the author's inner loop. A pack that is live and current but
827
- **withdrawn** from the catalog now says so, rather than reporting a clean bill of health.
828
-
829
- ## [0.1.15] - 2026-07-25
830
-
831
- ### Added
832
- - **`octwin agents [packId::agentId] [--prompt]` — see what your agent actually runs as.** The platform
833
- gained *governed* agent settings: an operator platform default can override the `default_model`
834
- (and history window / working-memory toggle) your manifest declares, and that override is invisible
835
- from the pack source. The command prints each governed setting's **effective** value, **which layer
836
- won** (project override → platform default → pack manifest), and warns explicitly when your pack's
837
- declared value is *not* in force. `--prompt` prints the exact system prompt the LLM sees for this
838
- project (pack instructions + platform protocol + any project overlay).
839
- - **`octwin orders [reference_id]` — the commerce a conversation produced.** The list (number,
840
- status/payment, total, contact) or one order with its line items, the
841
- subtotal/tax/shipping/discount/total breakdown, `payment_ref`, and the allowed transitions. On a
842
- `pending`/`none` payment it explains *why that's expected*: the forward payment lifecycle is
843
- **webhook-owned** (not patchable), and the default gateway-less `manual` driver makes
844
- `payment_request` take its `empty` port — so the flow should confirm pay-on-delivery, not error.
845
- - **`octwin analytics [entity]` — stage conversion for any pipelined entity.** The funnel engine that
846
- powered journeys is now generic, so any entity declared with a `pipeline:` charts conversion +
847
- drop-off (`--overview` / `--milestones` / `--trends` / `--cost`, and `--stage <id>` for the records
848
- currently at a stage). An empty result names **both** causes the platform folds into one response —
849
- no `pipeline:`, or no `view` grant on `record.<entity>`.
850
- - **`octwin catalog [--readiness]`** — commerce products with price, availability and stock
851
- (`untracked` when the SKU isn't inventory-tracked), plus the WhatsApp catalog binding.
852
- `--readiness` runs the Meta Graph checklist with each failing item's suggested fix.
853
- - **`octwin scheduling [--slots <resourceRecordId>]`** — the engine state (bookable resource types,
854
- upcoming slots, booked seats) or the computed slots for one resource. This is how you verify the
855
- availability rules a `deploy --seed` created, which 0.1.14 could create but not read back.
856
-
857
- ### Changed
858
- - **Auth failures now name the scope the command needs.** Every 401/403 appends the required scope
859
- (and the plan feature, where the route is entitlement-gated) from one client-side mirror of the
860
- platform's scope registry — replacing the per-command hardcoded strings, several of which named no
861
- scope at all. It also spells out that `pack:deploy` / `media:generate` are direct-grant only, so a
862
- `tenant:admin` preset token does **not** confer them (the most common "but my token is admin" dead end).
863
-
864
- ## [0.1.14] - 2026-07-23
865
-
866
- ### Fixed
867
- - **A failed demo seed no longer reports a clean `✓`.** `deploy` softens non-fatal
868
- install steps (e.g. a demo-seed row) to warning frames, but the summary still printed
869
- `✓ Deployed` and exited 0 — so a deploy that seeded ZERO records read as success (the
870
- false-✓ trap). `deploy` now collects those step errors, prints `⚠ Deployed with N
871
- warning(s) — data may be incomplete` with each message, and exits non-zero so CI /
872
- a `deploy && chat` chain catches it.
873
-
874
- ### Added
875
- - **`login` echoes what the token reaches.** After saving, `octwin login` calls
876
- `/api/self/t/whoami` and prints the workspace, project pin, and scopes — so a fresh
877
- token self-identifies without a second `octwin whoami` (best-effort; a network failure
878
- never fails the save).
879
- - **`validate --remote` surfaces warnings + the data-store trap.** The remote validate now
880
- renders advisory `⚠` warnings (which don't block deploy) and, for a pack declaring
881
- `required_adapters: [data-store]`, reports the missing-data-store error the deploy would
882
- have 409'd on — plus a warning that an `xrm.yaml` pack usually shouldn't declare that
883
- adapter at all. It also now catches (offline) a list-form `entities:` block and a
884
- `localized: true` field seeded with a bare string — traps that previously surfaced only
885
- mid-seed at deploy.
886
-
887
- ## [0.1.13] - 2026-07-22
888
-
889
- ### Added
890
- - **A headless media loop — produce + send.** Two paired additions close the coverage hole where any
891
- media-collect flow (e.g. `activate-app`'s registration / ID uploads) stalled at the upload prompt
892
- because the CLI could neither *make* nor *send* an image:
893
- - `octwin media generate "<prompt>" [--out <file.png>] [--size 1024x1024] [--json]` — AI-generates an
894
- image on the platform (needs a `media:generate`-scoped token), stores it as a public asset, and prints
895
- its `MEDIA-` handle + serve URL. `--out` downloads the bytes to a file (WhatsApp renders only
896
- `.png`/`.jpg`); `--json` emits `{ media_id, url, mime, width, height, bytes }`.
897
- - `octwin chat --media <file|media-id>` — uploads a local file (or a media id from
898
- `media generate --json`) as an image/document/audio inbound; any accompanying `"message"` rides as
899
- its caption. The platform's media pipeline folds the upload into a running collect, so media flows
900
- are now fully drivable headlessly.
901
-
902
- ### Changed
903
- - **The KB-drift nudge now names what changed.** With the platform serving per-entry content hashes, the
904
- post-command nudge appends a `(N changed · M added · K removed)` summary instead of a bare hash pair.
905
- - **`octwin platform-kb` prints a changelog on pull.** Instead of only a doc/catalog count, the pull now
906
- diffs the fresh index against your last pull and lists exactly which docs/catalogs were added (`+`),
907
- changed (`~`), or removed (`-`) — so a replaced schema shape is visible, not silent.
908
-
909
- ## [0.1.12] - 2026-07-22
910
-
911
- ### Fixed
912
- - **The KB-drift nudge now fires after `chat` too.** `chat` — the command a debugging session runs most —
913
- was missing from the networked-command list, so a chat-heavy session never noticed the platform's
914
- capability reference had moved. The nudge also now shows the concrete drift
915
- (`old-hash → new-hash`) so you can see it's real, not a heuristic.
916
-
917
- ### Changed
918
- - **Every networked command announces what it's doing before it does it.** `chat` prints
919
- `→ Connecting to <tenant>/<project> as '<handle>' …` before opening the stream and
920
- `… delivered — waiting for the reply (up to Ns)` after the send; `status` / `whoami` /
921
- `platform-kb` / `records` / `logs` / `cases` each print a one-line `→ …` header naming the
922
- action and target before the first network call — no more silent seconds followed by a result
923
- (or a hang with no clue what was being attempted). JSON modes (`--json`) stay clean for piping.
924
-
925
- ## [0.1.11] - 2026-07-21
926
-
927
- ### Fixed
928
- - **Auth-failure hint on every command, not just the inspect family** (author-feedback A7). `validate`,
929
- `deploy`, `status`, and the single-record read now print the scope/transient explanation on a 401/403
930
- (the shared `authFailureHint`), instead of a bare `HTTP 401` that left it ambiguous whether the token
931
- lacked a scope or the platform hiccupped.
932
-
933
- ## [0.1.10] - 2026-07-21
934
-
935
- The capability reference is now **pulled, never bundled** — the authoring skill dropped its committed KB
936
- snapshot, so `octwin platform-kb pull` is the single source of truth, and the CLI watches it for drift.
937
-
938
- ### Added
939
- - **KB-drift nudge** — after any command that already talks to the platform (`deploy` / `status` /
940
- `test` / `validate --remote` / `records` / `cases` / `logs` / `whoami`), the CLI does one tiny
941
- `octwin-platform-kb?meta=1` GET and prints a one-line "the platform capability reference changed —
942
- `octwin platform-kb pull`" when the platform's `content_hash` no longer matches your last pull.
943
- Fail-silent + TTY-only + no-op until you've pulled once — the sibling of the existing CLI-upgrade notice.
944
-
945
- ### Changed
946
- - **`octwin platform-kb pull`** now records the reference's `content_hash` in `.octwin/platform-kb/index.json`
947
- (the fingerprint the drift check compares against).
948
-
949
- The conversation-debugging release — driven by the second author-feedback round (xpeng-egypt),
950
- which found the author→validate→deploy loop solid but multi-turn debugging impossible from the CLI.
951
-
952
- ### Added
953
- - **`octwin chat --tap "<tap-id>"`** — press a rendered button / list row (sends the web channel's
954
- `type:'interactive'` inbound). Paired with full render printing, any tap-driven flow is now drivable headlessly.
955
- - **Full render printing** — every reply prints its complete interactive content: list sections/rows,
956
- buttons, and carousel cards, each with its **tap id**; header/footer/list-button text included.
957
- - **`--json` on `chat` / `logs` / `cases`** — raw SSE envelopes (chat) or raw event/case payloads.
958
- - **`octwin cases [caseId] [--queues]`** — inspect casework (support tickets): the inbox, one case +
959
- timeline + applicable decisions, or queue keys with open counts. Casework packs previously had zero
960
- data-inspection path (`records case` was a dead end).
961
- - **Per-subcommand `--help`/`-h`** — intercepted before any network or auth work (previously
962
- `octwin logs --help` made a network call and could die with a 401).
963
- - Multi-message turns: `chat` now collects **all** of a turn's renders (quiet-gap detection) instead
964
- of cutting at the first one.
965
-
966
- ### Changed
967
- - **`octwin logs`**: the conversation list shows contact handle + last activity and filters with
968
- `--as <handle>`; the timeline prints **full** event text (no more 240-char truncation) plus the
969
- renders each turn actually sent; footer points at `--json` / `mastra-messages` for verbatim payloads.
970
- - **Network failures name the target URL** (`platform unreachable at <url>`), and 401s explain
971
- invalid-token vs one-off transient instead of a bare status code.
972
- - `octwin records` on an unknown entity now surfaces the server's error body, and for `case`/`cases`
973
- points at `octwin cases`.
974
-
975
- ### Fixed
976
- - **Multi-turn chat actually works.** Two bugs made consecutive `octwin chat` calls look like "every
977
- call starts fresh": (1) the idempotency `local_id` was a **constant** per handle, so the platform's
978
- 5-minute inbound dedup silently dropped the second message — a fresh id is now minted per call;
979
- (2) a fresh SSE connect **replays** recent history and the CLI printed the first render frame — i.e.
980
- the *previous* turn's greeting — as the reply; the CLI now drains the replay and only accepts frames
981
- newer than the connect boundary. The platform always kept one open conversation per `--as` handle —
982
- the same handle genuinely continues the same conversation now.
983
-
984
- ## [0.1.8] - 2026-07-21
985
- - Global-first install guidance (`npm i -g octwin-cli`); upgrade notice suppressed under `npx`.
986
-
987
- ## [0.1.7] - 2026-07-21
988
- - `--version`/`-v` flag; daily fail-silent, TTY-only "newer version available" notice.
989
-
990
- ## [0.1.6] - 2026-07-21
991
- - `octwin init` scaffolds a home-hub menu (`home` list_picker + example `browse` tool) instead of a bare greeting.
992
-
993
- ## [0.1.5] - 2026-07-20
994
- - `octwin validate --remote` (the platform's FULL manifest + flow-DSL check, all errors at once);
995
- headless debugging commands `octwin records` / `octwin logs` / `octwin chat`; `octwin test` became
996
- an alias for `validate --remote`. First author-feedback round.
997
-
998
- ## [0.1.4] - 2026-07-20
999
- - Authoring reliability + DX fixes from the first end-to-end external-pack test.
1000
-
1001
- ## [0.1.3] - 2026-07-20
1002
- - `octwin platform-kb pull` — pull the platform capability reference for the authoring skill.
1003
-
1004
- ## [0.1.2] - 2026-07-20
1005
- - Proper npm README.
1006
-
1007
- ## [0.1.1] - 2026-07-20
1008
- - Initial npm publish: `init` / `validate` / `login` / `whoami` / `deploy` / `status`, `oct_` deploy tokens.
1
+ # Changelog — octwin-cli
2
+
3
+ All notable changes to the `octwin` CLI (npm package [`octwin-cli`](https://www.npmjs.com/package/octwin-cli)).
4
+ Format: [Keep a Changelog](https://keepachangelog.com/) — newest first, bucketed into
5
+ **Added · Changed · Deprecated · Removed · Fixed · Security**. The platform-wide view lives in the
6
+ repo root [`CHANGELOG.md`](../../CHANGELOG.md); this file is the CLI-only cut that ships with the package.
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [0.8.15] - 2026-10-06
11
+
12
+ ### Fixed
13
+ - **`octwin records` said nothing useful for a pack with no record types of its own.** Its message read
14
+ `has_xrm`, which the platform never sent, so it could not show. The platform sends it now; the CLI
15
+ says the pack declares no record types and that platform records still read by name
16
+ (`octwin records order | product | case`). `records create` and `records tasks` read `has_data` —
17
+ "no AI Agent is loaded in this project" — instead of the same unsent field.
18
+
19
+ ## [0.8.14] - 2026-10-06
20
+
21
+ ### Added
22
+ - **`octwin seed --reset`** — archive every row the pack's demo loaded, then load it again. Needed
23
+ once for demo rows seeded before 2026-10-05 (the seed says so), and a clean slate on demand; records
24
+ a customer made are never touched.
25
+ - **`octwin records <entity> --search "<words>"`** — the entity's ranked search (fuzzy, plus semantic
26
+ when the entity declares it), best match first, each row printed with its score. The platform has
27
+ served it to the console for months; the CLI never asked. `--json` returns the rows with their scores.
28
+ - **`press:<label>` in `octwin chat --script`, and `--press <label>`.** Taps the button of the reply just
29
+ received by its label — exactly, or the same words without emoji or case, or the one label containing
30
+ them. A form or checkout button's tap id carries its run id (`t:resume:…:run_id=…`), which exists only
31
+ once the reply arrives, so a script could not get past the first form step: `tap:` needs an id nobody
32
+ can write in advance. No match, or several buttons, stops the script and lists the buttons. A lone
33
+ `--press` picks from the reply the conversation is waiting on. The rules are the AI Author's `press`,
34
+ byte for byte (`src/lib/press.ts`). An older CLI sends a `press:` line as a typed message.
35
+
36
+ ### Fixed
37
+ - **`octwin chat` prints a card's link buttons and its forms.** A button that opens a link prints as
38
+ `[link] title → url` (a card may now carry links beside its reply buttons), and a form prints as
39
+ `[flow form] …` — it compared the hint type `'flow'`, which the wire never sends (`form_flow`).
40
+ - **`--json` output always parses.** `records --json` and `projects create --json` printed a
41
+ `→ Reading …` line in front of their JSON, and `logs --json` with no conversations printed a sentence
42
+ and no JSON at all (reported 2026-10-01). Under `--json`, stdout now carries the result and nothing
43
+ else — progress, tables and hints go to stderr — and every write verb of a JSON command (`records
44
+ create`, `work note`, `agents set`, `catalog stock`, `scheduling rule add`, `projects rm --yes`, …)
45
+ returns what the platform answered. A test runs every JSON command and parses its stdout.
46
+ - **`octwin chat` prints the pictures, files, voice notes and map pins a reply carries.** Only a reply's
47
+ text and buttons were printed, so a reply that sent a picture read as a caption with nothing under it.
48
+ Now `[image] <path>` (without the signed query), `[file] <name> → <url>`, `[voice note] 12s → <url>`,
49
+ `[location] <name> (lat, long)`, and `(image)` on a carousel card that has a picture
50
+ (`src/lib/media-lines.ts`).
51
+
52
+ ### Changed
53
+ - **`--json` on a command that has no JSON output is refused by name** (`whoami`, `deploy`, `validate`,
54
+ …), with the list of commands that have it. It used to print the prose to stderr and leave stdout
55
+ empty. `chat --json` and `login --json` print one JSON object per line, as before.
56
+ - **Under `--json`, the progress lines move from stdout to stderr.** A script that read them from stdout
57
+ reads them from stderr now; human output (no `--json`) is unchanged.
58
+ - **`octwin pull` can pull an Octwin (first-party) pack.** The platform now lets a workspace read the
59
+ source of its own packs and of Octwin's — never another workspace's — and the 403 hint says so. A
60
+ platform change: an older CLI pulls first-party packs too, it only prints the older hint.
61
+
62
+ ## [0.8.13] - 2026-09-27
63
+
64
+ ### Added
65
+ - **`octwin records archive <id>` / `restore <id>`.** Archive is how a record leaves use — test data
66
+ included: it drops out of every list, count and report and fires the entity's `on.archived`
67
+ reactions, exactly like the console's Archive; `restore` undoes it. There is no delete, on the
68
+ platform or here, and `octwin records --help` now says so.
69
+
70
+ ### Fixed
71
+ - **`octwin chat` said the AI Agent wrote every message.** A reminder that fired mid `--script` (a
72
+ `schedule_notify`, a reaction) printed as `← <body>`, was taken for the turn's reply, and ended
73
+ the turn on it — so the real reply looked lost while `octwin logs` showed the flow had worked.
74
+ Each line now says who sent it: `← [notify] …` (not the turn's answer — the wait for the real
75
+ reply goes on), `← [operator: Name] …` (a person in Live chat), `← [platform] …` (a handoff
76
+ joining or returning); plain `← …` is the AI Agent. After the last turn the stream stays open
77
+ 3 s more, so a late message prints (marked "after the last turn") instead of reaching a closed
78
+ connection. Needs a platform that stamps `source: 'notify'` on web renders; an older one just
79
+ prints notifies unlabelled, as before.
80
+ - **The "no such template" hint named a file the platform never loads.** It said
81
+ `templates/<name>.yaml`; pack templates load only as `templates/<name>.template.yaml`, so a
82
+ template saved as the hint said was silently ignored.
83
+
84
+ ### Changed
85
+ - **`octwin validate` runs the platform's FULL check by default — and needs no login for it.** The
86
+ offline checks are a subset, and a subset that passes read as "deploy will pass": it passed a pack
87
+ the full check refused (a scaffold flow left behind with Arabic copy only, in a pack that ships
88
+ English). Now `validate` runs the offline checks, then the full one: through your workspace when you
89
+ have a token AND a `--project` (which also confirms the project exists), otherwise through the
90
+ platform's public validate route with no credential. When it cannot reach the full check — no url,
91
+ offline, rate-limited, an older platform — the LAST line says *"only the OFFLINE check ran — a
92
+ PARTIAL check"* and why, and it exits 0 as before. `--remote` now means "the full check is
93
+ required" (not reaching it is an error); the new `--offline` runs only the subset.
94
+ - **The scaffold's example `browse` flow says it is an example.** Its header, its copy file and its
95
+ `manifest.yaml` line now say to replace it, or delete the flow, every `browse.locale.*.yaml` and the
96
+ `flows:` line together — a leftover never loads, but a second language makes it fail validation.
97
+
98
+ ## [0.8.12] - 2026-09-25
99
+
100
+ ### Changed
101
+ - **The package pointed its `homepage` at npm — the page it is rendered on.** It is
102
+ <https://octwin.ai> now, and the README's Links section gains the platform, the guides and the
103
+ marketplace. The README describes Octwin at length and linked only to npm and nodejs.org.
104
+ - **`octwin usage` with a project-pinned token reports that project.** The platform now treats a
105
+ token's project pin as a ceiling on every route, so a pinned token is refused on the
106
+ workspace-wide rollup. `usage` asks `whoami` for the pin and reads the project view instead of
107
+ printing a 403 — which is what its help text (`project if pinned, else workspace`) always said.
108
+
109
+ ### Fixed
110
+ - **`octwin chat` sat out its whole 45-second wait on every message during a live handoff, and
111
+ read as hung.** While a person holds the conversation (or one has been asked for) the AI Agent
112
+ deliberately answers nothing, and the CLI could not tell that from a slow pack. The platform now
113
+ says so with a `held` event on the web stream; `chat` prints
114
+ *"⏸ a person is holding this conversation — the AI Agent will not reply…"* (or *"waiting for a
115
+ person to join…"*), still collects any operator line replayed by that message, and returns. A
116
+ held turn is not a failure: it exits 0, and `--script` carries on to the next line, so the
117
+ customer's side of a handoff can be scripted. Needs a platform that sends `held`; an older one
118
+ behaves as before. Reported in `xpeng-egypt/FEEDBACK.md`, session 3.
119
+
120
+ ## [0.8.11] - 2026-09-07
121
+
122
+ ### Fixed
123
+ - **`octwin login` erased your own tooling report — the CLI was blanking what it had just
124
+ told the platform.** Two calls built their `authorization` header by hand instead of going
125
+ through `authHeaders`: `login`'s post-save "here's what your token reaches" echo, and
126
+ `chat`'s tenant/project derivation. Both authenticate, so both stamp the token's client
127
+ report (added in 0.8.9) — and a hand-built header stamps **NULL**, wiping the CLI version
128
+ and reference hash the platform had recorded.
129
+
130
+ Caught within an hour of 0.8.9 reaching staging: a workspace reported `0.8.9 · reference
131
+ current` at 12:16 and read `not reported` at 12:34. That looked exactly like the documented
132
+ "the column holds what ran LAST" behaviour and was really the CLI erasing its own row.
133
+ `cli-routes.test.ts` now fails on any hand-built bearer header, with a non-vacuity floor —
134
+ this package sits outside the repo's eslint scope, so a text guard is the only rung available.
135
+
136
+ ## [0.8.10] - 2026-09-07
137
+
138
+ ### Fixed
139
+ - **`octwin memos` failed with `400 project required` for a tenant-wide token — the exact
140
+ command the nudge tells you to run.** Every networked command can end with
141
+ *"✉ N memos from the platform — read them: `octwin memos`"*, and running precisely that with
142
+ an unpinned token answered a 400. Measured on staging: the nudge fired during a
143
+ `deploy --project …` (which supplied a project) and then named a command that could not run.
144
+
145
+ A memo has no project dimension to scope by — neither `pack_memos` nor `pack_memo_reads`
146
+ carries a `project_id`, and the read ledger is keyed by tenant — so the three call sites now
147
+ use `/api/self/t/memos`. Passing `--project` still works and is no longer needed.
148
+
149
+ ## [0.8.9] - 2026-09-07
150
+
151
+ ### Added
152
+ - **Every authenticated request now says which CLI and which capability reference you are on.**
153
+ Two headers off `authHeaders` — `x-octwin-cli` and `x-octwin-kb` (the `content_hash` of your
154
+ pulled reference) — so `deploy`, `validate --remote`, `status`, `chat`, `logs` and `memos` all
155
+ carry them, from one place. The platform stores them against your deploy token and shows them in
156
+ the console (Settings → API tokens, and Platform → Packs → Feedback → Author tooling for us).
157
+
158
+ **Why the platform needs this from you.** Almost every field report so far turned out to be
159
+ either already fixed in a newer CLI or written against a stale reference — three very different
160
+ answers that look identical without these two facts. They were captured on `octwin feedback`
161
+ only, so an author who never filed a report was invisible. Nothing here affects auth: a request
162
+ that sends neither header authenticates exactly as before, and a value that could not travel as
163
+ a header (a corrupt `package.json`, an interrupted pull) is dropped rather than sent.
164
+
165
+ ### Fixed
166
+ - **The upgrade notice was skipped under `npx` — silencing the population most likely to be
167
+ stale.** The premise was that "`@latest` already resolves the newest", which holds for
168
+ `npx octwin-cli@latest` and is false for the bare `npx octwin-cli` the docs put in front of
169
+ external developers: npm serves that from its **cache**, so it can be arbitrarily old. Under
170
+ `@latest` the check is self-silencing anyway (you are already newest), so keeping it costs
171
+ nothing — only the advice line differs, because there is no global install to reinstall.
172
+
173
+ ## [0.8.8] - 2026-09-06
174
+
175
+ ### Added
176
+ - **`octwin login` can sign you in through a browser — no token is pasted anywhere.** Run it with
177
+ no `--token` and it prints an approval link:
178
+
179
+ ```
180
+ Open this link to approve: https://app.octwin.ai/cli-login?code=WDJB-MJHT
181
+ Code shown on that page: WDJB-MJHT
182
+ ```
183
+
184
+ A workspace admin opens it, checks which machine is asking, and clicks Approve; the CLI collects a
185
+ 30-day token by itself and saves it exactly where `--token` would have. `octwin login --token oct_…`
186
+ is unchanged, and CI should still skip login entirely and set `PACK_PLATFORM_URL` + `PACK_TOKEN`.
187
+
188
+ **The wait is bounded and resumable, because this CLI is mostly driven by an agent.** An agent's
189
+ shell call is killed after about two minutes, and a wait that outlives its caller is worse than a
190
+ short one — the process dies mid-handshake and the code the human is still typing belongs to
191
+ nothing. So `login` waits 90 seconds, then exits **75** (`EX_TEMPFAIL`) with the handshake kept in
192
+ `~/.octwin/pending-login.json`; running it again resumes the **same** code, which the platform
193
+ keeps alive for ten minutes. `0` still means signed in and `1` still means failed, so an agent
194
+ branches on the exit code instead of parsing prose. `--wait <seconds>` overrides the 90 (`--wait 0`
195
+ prints the code and returns at once), and `--json` prints the same facts as an object.
196
+
197
+ **Approve only a link you opened because you ran the command.** The link carries the code
198
+ (RFC 8628 `verification_uri_complete`), so the click *is* the consent: approving a link somebody
199
+ sent you would connect their machine to your workspace. The console says so on the page. The code
200
+ is printed here too, and shown there, so you can always tell one request from another.
201
+
202
+ The pending handshake gets its own file rather than a new key in `credentials.json`: every value
203
+ in that file is a token, and its one reserved key (`default_url`) is collision-free only because a
204
+ platform url always contains `://`. A second value shape there would end that argument.
205
+
206
+ - **A 401 now points at `octwin login`, not at the console.** With a 30-day browser token, renewing is
207
+ one command; the old hint sent people to mint a replacement by hand. Mint a token yourself if you
208
+ want a different lifetime — the console offers 30 / 90 days / a year / never.
209
+
210
+ ## [0.8.7] - 2026-09-06
211
+
212
+ ### Added
213
+ - **`validate` now reads a map's KEYS, not only its values.** The declaration walker reported four
214
+ things — an unknown key, a missing `required` key, a wrong scalar type, a value outside a closed
215
+ `enum` — and every one of them is about a VALUE. But a map's keys carry meaning in several
216
+ declarations (`roles.yaml` grant resources and verbs, `xrm.yaml` entity names), and those keys had
217
+ no check at all. Rule 5 replays `propertyNames` — both the `enum` and the `pattern` form.
218
+
219
+ This is why publishing the RBAC vocabulary was worth doing. A pack author wrote `case:` where the
220
+ grant key is `record.case`, passed offline `validate` clean, and learned the truth one bad guess at
221
+ a time from `--remote` round-trips. They gave up on custom RBAC over it. The check now says
222
+ `not a valid key here — must be one of "record.case", …` before a deploy is attempted.
223
+
224
+ It stays inside the file's false-positive rule because it is a **faithful replay**: the same `enum`
225
+ membership and the same JS regex engine Zod itself runs, over a pattern the platform generated. A
226
+ pattern this engine cannot compile is treated like a combinator — walk away, do not guess.
227
+
228
+ Verified 2026-09-06 against the shipped binary: across all 23 marketplace packs rule 5 reports
229
+ **nothing**, with 10 of the 12 pulled declaration schemas carrying `propertyNames` (so the silence
230
+ is a result, not an unexercised branch). A deliberately broken key is caught on both branches — a
231
+ role named `Regional-Agent` against `^[a-z][a-z0-9_]*$`, and a grant key `case:` against an enum
232
+ vocabulary — each naming the file, the path and the rule it broke.
233
+
234
+ ### Fixed
235
+ - **`deploy` had stopped printing its seed counts entirely.** `printDeploySuccess` read
236
+ `r.summary.records` / `.updated` / `.images` / `.rules` / `.failed`, but the deploy route's
237
+ `summary` is a run-log **string** (`"clinic v1.2.0 — {…}"`), not an object. So every field was
238
+ `undefined`, `parts` stayed empty, and the `if (parts.length)` guard turned *"I am reading the
239
+ wrong field"* into *"there was nothing to say"* — the block printed nothing and looked like a
240
+ deploy that simply seeded no rows. The counts have been on `r.seeded`, keyed by seed kind, and
241
+ `printSeedCounts` already renders them (filtering zeros, which is what makes a partial seed
242
+ legible). The dead block is gone and `printSeedCounts` is called instead.
243
+
244
+ Same shape as the bug 0.8.6 fixed in `validate`: *no data* and *no problem* rendering identically.
245
+ Two independent places in this CLI reached it within one week.
246
+
247
+ ## [0.8.6] - 2026-09-04
248
+
249
+ ### Changed
250
+ - **`validate` can no longer print a `✓` for a check that did not run.** Each of the eight
251
+ checks now RETURNS an `Outcome` — `passed`, `findings`, or `not-run` — and a single printer
252
+ renders all of them, groups the skips by reason, and computes the exit code. Previously each
253
+ check printed its own `✓` inside the `if` that held its data, with a `skipped[]` array and a
254
+ `skipReasons` Map maintained alongside; it was correct because someone was careful, and the
255
+ next check added was one `if` away from lying again.
256
+
257
+ It had lied twice, in the same shape: the KB-dependent block once printed ONE `✓` above six
258
+ checks whose own `✓`s lived inside their `if`s (so a run with no pulled KB read as "one check,
259
+ passed", and an entire backlog batch reached production that way), and `yamlDocs()` once
260
+ dropped an unparseable file so `validate` printed all-green over a pack the platform's importer
261
+ then refused. **An unparseable file is not "no findings", it is "no idea", and those must never
262
+ print the same** — a check that returns nothing now cannot reach the `passed` branch at all.
263
+
264
+ Output is unchanged for a normal run. `passed` carries its own line, so the reserved-entity
265
+ check keeps the narrower wording it uses when the catalog rules are absent from an older pull.
266
+ `--require-kb` is now one line over the returned skip list.
267
+
268
+ Verified 2026-09-04: all 23 marketplace packs exit 0 with no findings; a pack with no pulled KB
269
+ prints zero `✓` for the six KB-dependent checks plus one grouped ⚠ naming all six, and
270
+ `--require-kb` exits 1; a duplicate YAML key still exits 1 naming the file.
271
+
272
+ ## [0.8.5] - 2026-09-02
273
+
274
+ ### Added
275
+ - **`octwin work --unrouted`** — the inbox filtered to items in NO queue. The route has always
276
+ supported the filter; the CLI never passed it, so `--queues` could tell you a count and not
277
+ show you the items behind it.
278
+
279
+ ### Changed
280
+ - **`octwin work --queues` leads with the unrouted count.** It was already printed, as
281
+ `(unrouted: N open)` tucked under the queue list. A routed item sits in a list someone works;
282
+ an unrouted one sits in nobody's, so it is the only line on that screen that means "these are
283
+ lost". It is now a warning block that names the likely cause and points at `--unrouted`. Still
284
+ silent at zero — a clean project stays quiet, or the warning stops meaning anything.
285
+
286
+ ## [0.8.4] - 2026-09-02
287
+
288
+ ### Fixed
289
+ - **A deploy whose seed failed still led with `✓ Deployed`.** The step errors were never
290
+ missing — `readDeployProgress` has collected every `status:'error'` frame into `stepErrors`
291
+ since 0.1.14, printed them, and exited non-zero. They were printed *after* `printDeploySuccess`,
292
+ so the first and largest line said `✓ Deployed` and the ⚠ came underneath. A pack author
293
+ reported their deploy as a clean success while its demo seed had failed; they were reading the
294
+ transcript exactly as written. The count now goes INTO the headline, which reads
295
+ `⚠ Deployed <id>@<v> onto <target> WITH n failure(s) — data may be incomplete`. `octwin seed`
296
+ gets the same treatment. *A signal that arrives after the verdict is not a signal.*
297
+ - **The non-streaming deploy and seed paths had no step-error check at all.** With no SSE frames
298
+ to read, a failed seed printed a clean `✓` on that path even after the streaming one was fixed
299
+ in 0.1.14. Both now read `seed_failed` from the response body (new in the platform alongside
300
+ this release), print each failed kind with its reason, and exit non-zero.
301
+ - **A partial demo seed is now reported as partial.** The platform no longer abandons the rest of
302
+ the seed when one demo row throws, so `Seeded:` gains an `n row(s) FAILED` part — without it a
303
+ partial seed reads as a complete one that simply had fewer records than the author wrote.
304
+
305
+ ## [0.8.3] - 2026-09-02
306
+
307
+ ### Fixed
308
+ - **`validate` printed all-green over a pack the platform could not import.** Every YAML file was
309
+ parsed inside a `try { … } catch { return [] }`, so a file that failed to parse was silently
310
+ DROPPED from the list and every later check skipped it. The `catch` was justified in a comment —
311
+ "a syntax error is the structural gate's to report" — and that was not true: the structural gate
312
+ (`validatePackBundle`) checks paths, extensions and traversal, and never parses YAML.
313
+
314
+ Measured 2026-09-02: a duplicate `s_header:` key in a locale file passed `octwin validate` twice
315
+ and was then refused by the platform importer with `Map keys must be unique at line 24,
316
+ column 3` — the same message, from the same `yaml` version the CLI already had. The author's only
317
+ clue was a red box in the console naming no file.
318
+
319
+ YAML syntax is now its own announced gate that FAILS: it names each unparseable file with the
320
+ parser's own message and exits non-zero, before any check reads a document. An unparseable file is
321
+ not "no findings", it is "no idea", and the two must never print the same.
322
+
323
+ - **Three more readers that turned "I could not read this" into a normal answer.** Swept every
324
+ discarding `catch` in the CLI after the above; three collapsed a real fault into an ordinary state:
325
+ - `readCreds` returned `{}` for a CORRUPT `credentials.json` as well as an absent one, so a token
326
+ the author knows they saved simply stopped being found and the advice was "log in" with no
327
+ mention of why. Now names the file and the parse error, once per process (it has three call
328
+ sites and one broken file is one problem).
329
+ - `readLocalKb` returned null for a half-written `.octwin/platform-kb/index.json` as well as a
330
+ never-pulled one — so an interrupted pull read as "you have not pulled yet" and the author
331
+ re-ran the command that left it that way. [`kb-path.ts`](src/lib/kb-path.ts) states this rule
332
+ for the DIRECTORY lookup; the index read beside it kept collapsing anyway. It now says which.
333
+ - The deploy progress stream discarded unparseable SSE frames silently. Skipping one is right;
334
+ skipping ALL of them left `terminal: null`, reported as "the stream ended without a terminal
335
+ event" — true, and indistinguishable from a dropped connection. The count is now named when
336
+ (and only when) no terminal frame arrived, pointing at a CLI older than its platform.
337
+
338
+ The other five discarding catches were read and LEFT: each returns a documented fallback for a
339
+ state that is genuinely ordinary (no update-check network, a heartbeat SSE frame with no `data:`).
340
+ `scripts/` was swept too and is clean by design — `kb-dataflow.mjs` skips a fence it cannot parse,
341
+ and `check-kb-examples.mjs` holds a non-vacuity FLOOR of 130 parsed fences so the skip cannot go
342
+ quiet. That is the better pattern where a skip is legitimate.
343
+
344
+ ## [0.8.1] - 2026-08-27
345
+
346
+ ### Fixed
347
+ - **Logging in made `platform-kb pull` WORSE.** The command preferred the tenant-scoped route
348
+ whenever a token was saved, and that route is guarded by `pack:deploy` — so a developer holding a
349
+ token without that scope got a **403 on a pull that succeeds with no token at all**. It is the
350
+ likeliest token a new developer holds: no console preset could even reach `pack:deploy` before
351
+ 2026-08-26. `platform-kb` now always uses the anonymous route and never sends a credential.
352
+ `--token` is accepted and ignored so existing scripts keep working.
353
+
354
+ The platform serves the *same* bundle from all three of its views — its route file states the
355
+ payload is identical and tenant-independent — so the authed route returned nothing extra and the
356
+ credential could only ever subtract. The two reasons the old code gave did not survive checking:
357
+ "keeps the author's own instance the source of truth" is vacuous (both routes are the same
358
+ instance), and "works against platforms that predate the public rung" is a backward-compatibility
359
+ shim this codebase does not carry.
360
+ - **The drift nudge now works without a token.** It polled through the same authed route, so an
361
+ author inspecting data with a narrow token was told, every time, that it *could not* check —
362
+ advice in place of the signal. Both the poll and the apology are gone: the poll is anonymous, so
363
+ it simply works.
364
+
365
+ ## [0.8.0] - 2026-08-27
366
+
367
+ ### Added
368
+ - **Five new command families, closing the gap between what a token reaches and what the CLI can
369
+ ask.** A **Full CLI access** token spans the whole scope registry, and four of those domains had
370
+ no command at all — so the reach existed and there was nothing to type.
371
+ - `octwin automation [campaigns]` — every job the pack's declaration produced, with status,
372
+ interval and last result (matched / acted / errors), under a health line whose counts come from
373
+ SQL rather than from filtering the page (the job list is capped server-side, so a client-side
374
+ count would depend on the cap). Writes: `run` · `pause` · `resume` · `send <campaignId>`.
375
+ - `octwin integrations` — what the pack **declares** beside what is actually **configured**, in
376
+ one view, because a connection declared and never configured is the commonest reason an
377
+ integration silently never fires and neither list alone can show it. Plus
378
+ `preflight <key>` (diagnosis, no outbound call, `integrations:read`), `test <key>` (a live call,
379
+ `integrations:write`, exits 1 on failure), `deliveries [id]`, `retry|cancel|send-now <id>`,
380
+ and `events` for what arrived inbound.
381
+ - `octwin journeys [id] [--funnel|--overview|--goals|--trends|--cost|--definition] [--stage <id>]`
382
+ — the declared journeys, measured. Same flag grammar as `octwin analytics` on purpose: a journey
383
+ funnel and an entity funnel are the same question about different subjects. `--definition` is
384
+ the one view that works with no traffic.
385
+ - `octwin performance [--detail]` — the project's business indicators, each with its delta against
386
+ the previous window and the `why` naming the declaration it came from. Needs `records:read`, not
387
+ a `performance:*` scope (there is none), so a read-only token already reaches it.
388
+ - `octwin usage` — model calls, tokens and cost, by model / kind / agent / channel; project when
389
+ one is pinned, workspace otherwise. Needs no particular scope. **Model spend only** —
390
+ WhatsApp/Meta message billing is operator-only and outside the token scope registry, which the
391
+ output says rather than leaving as an absence.
392
+ - **`octwin automation run|pause|resume|send` accept the declaration KEY.** The routes take a UUID
393
+ and answer a bare *"Malformed identifier in the URL"* 400 for anything else — but the key
394
+ (`cart_recovery_nudge`) is what the list prints and what the author wrote in their own YAML. The
395
+ key is now resolved against the list route, and an unknown one fails naming the keys that exist.
396
+
397
+ ### Fixed
398
+ - **A body-less write sent `content-type: application/json` and no body, so Fastify answered a bare
399
+ `400 Bad Request`.** `apiSend` set the header unconditionally; every caller until now passed an
400
+ object, so the branch was dead and the bug latent. The first body-less POST (`automation run`) hit
401
+ it immediately. The header is now omitted when there is no body — rather than each caller learning
402
+ to pass `{}`, which is the per-site divergence that helper exists to prevent.
403
+ - **Four URLs were exempt from the route guard.** `cli-routes.test.ts` reads a template literal in
404
+ the first argument position, so `apiGet(base, t)` — a bare identifier — was never checked. That
405
+ covered the `scheduling` engine-state and `agents` roster calls, and would have covered the new
406
+ `journeys`, `performance` and `usage` ones. All now spelled as literals: the guard checks **62**
407
+ URLs, up from 45.
408
+
409
+ ## [0.7.3] - 2026-08-26
410
+
411
+ ### Changed
412
+ - **A marketplace listing request is now OPT-IN: `octwin deploy --request-listing`.** A plain
413
+ `octwin deploy` says nothing about the public marketplace — it neither asks for a listing nor
414
+ gives one up. `--withdraw-listing` retracts, including an approved listing.
415
+ **Why:** the request was read from the manifest's `listing.public` on every deploy, and deploying
416
+ is how you *test*. 17 of the 23 published packs carry that key, so an edit-deploy-chat loop filed
417
+ a review request every time round. Worse, the *absence* of the key meant **retract** — so an
418
+ ordinary deploy of a pack whose manifest you had not yet annotated could wipe a listing you
419
+ already had. `--request-listing` still requires `listing.public: true` in the manifest (the
420
+ manifest states that the pack is a product; the flag is you choosing to ask), and the flag
421
+ without the key is a clean error rather than a silent no-op.
422
+ - **The listing verdict distinguishes "you submitted this" from "your approval expired".** They are
423
+ both `pending` and they mean opposite things to an author. A deploy that changes the content of an
424
+ approved pack now says so in those words — an approval covers only the content it was made
425
+ against, so it cannot survive an edit.
426
+
427
+ ### Added
428
+ - **A one-line nudge when your manifest asks and your deploy did not.** A pack carrying
429
+ `listing.public: true` that has never been submitted now prints the flag to use, so an opt-in
430
+ default cannot turn into waiting for a review nobody requested.
431
+
432
+ ### Fixed
433
+ - **The "newer CLI" and "KB drifted" notices now print when a command FAILS.** All three nudges
434
+ (CLI upgrade · KB drift · unread memos) were awaited at the very end of `main()`, which silently
435
+ meant *only on success* — `die()` is a hard exit, so a failed deploy, an auth error or a bad
436
+ manifest printed none of them. That is backwards: a stale capability reference is a leading cause
437
+ of the failure an author is staring at, so the run that most needed the nudge was the only one
438
+ that never got it. They are now computed before the command and printed however it ends.
439
+ - **The CLI-upgrade notice is no longer hidden from piped output.** It began with
440
+ `if (!process.stdout.isTTY) return`, so every agent-driven and CI run — the readers that cannot
441
+ notice an outdated CLI on their own — was the one audience never told. Its two siblings had
442
+ already dropped that gate for exactly this reason; now all three agree. Still skipped under
443
+ `npx`, where there is nothing to upgrade.
444
+ - **`octwin login` now reports KB drift too.** It is networked and usually the first command of a
445
+ session, i.e. the best possible moment to say the reference moved, and it was excluded.
446
+ - **A memo poll can no longer fail the command it was annotating.** It went through `apiGet` →
447
+ `fetchOrDie`, whose job is to `die` on a network failure — so an unreachable platform turned an
448
+ observer into a command failure. It now uses a plain, timed, fail-silent fetch.
449
+ - **A failing command reports its real exit code again on Windows.** Moving the polls before the
450
+ command made `process.exit()` abort with `Assertion failed: !(handle->flags & UV_HANDLE_CLOSING)`
451
+ and return **127** instead of 1 — so CI saw neither success nor the documented failure code. The
452
+ CLI now unwinds through a `CliExit` and lets the event loop drain, which is the only teardown
453
+ that is clean once the polls have opened sockets. `--check`'s exit 2 and the streaming commands
454
+ were re-verified.
455
+
456
+ ## [0.7.2] - 2026-08-20
457
+
458
+ ### Fixed
459
+ - **`octwin feedback` now tells you what is already waiting, on stdout.** It discarded the submit
460
+ response entirely — destructuring `{ status, json }`, checking the status and never reading the
461
+ body — then printed *"a reply arrives as a memo, this CLI will tell you when one is waiting"*. The
462
+ platform started returning the unread counts on that response (2026-08-20), so the answer was
463
+ there to print and was being thrown away.
464
+ **Why it matters more than it sounds:** `notifyIfMemosWaiting` already covers this command and was
465
+ firing correctly — but it writes to **stderr**, and the authors driving this CLI are agents reading
466
+ stdout. The one signal that mattered was addressed to a channel nobody was listening on. On
467
+ 2026-08-19 an author submitted two reports two hours after three replies were published and
468
+ re-reported five findings those replies had already closed. Now the count prints in the same block
469
+ as the acknowledgement, naming the command, and says outright when a reply may already answer what
470
+ you just sent. Against an older platform the field is absent and the previous line stands.
471
+
472
+ ## [0.7.1] - 2026-08-19
473
+
474
+ ### Fixed
475
+ - **`work decide` now says when an action moves nothing.** `to_stage` is optional — an action may
476
+ record a decision without a transition — but both outputs communicated that by omission: `--dry-run`
477
+ left `to_stage: null` sitting among twenty other keys, and a real apply printed a bare
478
+ `✓ Applied '<action>'`. An author read both, shipped `request_more_info` with no `to_stage`, and
479
+ lost the `awaiting_customer` their whole customer-reply capture branched on — their words: *"Nothing
480
+ about this failed loudly; it just quietly never did the one thing the whole feature depends on."*
481
+ The preview now states `→ does NOT change the status (this action only records a decision)` and the
482
+ apply says `status unchanged (the action declares no to_stage)`. The console's decision panel got the
483
+ same sentence in the same change.
484
+
485
+ ## [0.7.0] - 2026-08-18
486
+
487
+ ### Added
488
+ - **`octwin memos` — the channel answers now.** `octwin feedback` was one-way: an author reported and
489
+ heard nothing, ever. Two kinds arrive here, both printed in full — a **reply** to a report you sent,
490
+ and a **notice** published to every author (a new capability, a deprecation, a breaking change) —
491
+ each carrying `info` / `action_required` / `breaking`. Reading marks them read; `--all` re-reads
492
+ history and acks nothing (also the escape hatch if a piped `--json` consumer died halfway).
493
+ - **Every networked command now says when a memo is waiting**, one line to stderr, always naming the
494
+ command to run. It rides work that was already networked, never throws, and is **deliberately not
495
+ TTY-gated** — the same reasoning as the KB drift nudge, whose docblock says it plainly: the primary
496
+ reader of this CLI is an authoring agent whose output is piped, and gating on `isTTY` means the one
497
+ reader that cannot notice on its own is the only one never told. Unlike that check there is no local
498
+ marker file: read state is per-workspace on the platform, so an agent in a fresh container still
499
+ learns about an unread reply.
500
+
501
+ Why it matters, measured: in August 2026 four reports sat unread for nine days, and one author
502
+ replaced every `$t()` call with hardcoded English across all 16 flows of a production pack to work
503
+ around a bug that had been fixed two days earlier. Nothing could tell them.
504
+
505
+ ## [0.6.1] - 2026-08-18
506
+
507
+ ### Fixed
508
+ - **`octwin status` worked for no pack at all, and had not since 2026-08-01.** It sent the manifest's
509
+ **bare** id (`clinic`) to a route that requires the qualified `<owner>.<name>` — and a manifest
510
+ cannot legally declare the qualified form, because the owner segment is attached at publish time
511
+ from the authenticated publisher (both the platform and this CLI reject a `.` in it). So the route
512
+ answered 404 for every pack, every time. It now resolves the owner from `whoami`'s `tenant_slug`,
513
+ and takes an explicit `octwin status <packId>` when you already know it (from `octwin agents` or
514
+ `octwin projects`, both of which print qualified ids). Reported by two pack authors, who lost time
515
+ to a command that said their pack was missing seconds after a deploy the platform had accepted.
516
+ - **A 404 from `octwin status` no longer always reads "not installed".** That one branch covered four
517
+ different failures — a malformed pack id, an unknown tenant, an unknown/pinned-elsewhere project,
518
+ and the genuine no-active-install — so the message named the *least* likely cause and sent an author
519
+ chasing a deploy that had already succeeded. The route says which; the CLI now relays it, and adds
520
+ the "run `octwin deploy` first" hint only to the case it fits.
521
+ - **`octwin logs` always reported "No conversations"**, including immediately after an `octwin chat`
522
+ that had plainly worked. It read `conversations` off the response; the platform moved that endpoint
523
+ to the shared page envelope on 2026-08-09 and answers `rows`, which every other list command here
524
+ already reads. Both authors filed this as replica lag or a cache gap — nothing lagged, the payload
525
+ was simply never read. `octwin logs <conversationId>` was unaffected.
526
+
527
+ ## [0.6.0] - 2026-08-09
528
+
529
+ ### Changed
530
+ - **`octwin cases` is now `octwin work`, and it works again.** The platform's work-inbox
531
+ consolidation (2026-08-08) replaced the case-only surface with `/work` over every entity a pack
532
+ declares worked, and renamed the scopes to `work:read`/`work:write` — which left every `octwin
533
+ cases` call a silent 404 in a published CLI. The command family is renamed to match the platform:
534
+ `octwin work [recordId] [--queues]`, with writes `assign` / `note` / `decide` (the declared
535
+ operator actions, `--dry-run` previews) and `stage <id> --to <s>` riding the one platform-wide
536
+ stage verb (`POST …/xrm/records/:id/stage`, needs `records:write`). `transition` is gone with the
537
+ route it called.
538
+ - **`octwin orders transition` rides the same stage verb.** `POST …/orders/:ref/transition` was
539
+ retired server-side in the same consolidation; the CLI now resolves the order's record id from the
540
+ detail read and moves the stage through `…/xrm/records/:id/stage` (scope: `records:write`).
541
+
542
+ ### Added
543
+ - **A route guard so this cannot rot silently again**: `src/lib/cli-routes.test.ts` extracts every
544
+ `/api/self/**` URL the CLI builds and asserts it (method included) against the platform's dumped
545
+ route table — the gap that let both breakages above ship.
546
+
547
+ ## [0.5.1] - 2026-08-01
548
+
549
+ ### Fixed
550
+ - **`validate --remote` blamed the platform's version for a bad `--project`.** Every 404 from
551
+ `POST /api/self/p/packs/validate` printed *"this platform has no /packs/validate endpoint yet
552
+ (older version)"*. That was accurate when the route resolved nothing, but it now resolves the
553
+ tenant and project **before** validating — and an unknown project, or one outside a token's pin,
554
+ answers 404 by design. So a typo in `--project` sent you looking for a version mismatch instead of
555
+ at the flag. The two cases are now told apart by the response **body**, not the status: a missing
556
+ route is Fastify's `error: 'Not Found'` and keeps the old wording, while the platform's own
557
+ `project '<slug>' not found under tenant` is printed as-is, with the flags to check.
558
+
559
+ ## [0.5.0] - 2026-08-01
560
+
561
+ ### Added
562
+ - **`octwin seed [--pack <packId>]`** — apply the pack's demo/reference data to the project it is
563
+ installed on, without redeploying: `xrm.yaml` `demo:` records + scheduling availability, the
564
+ commerce catalog, and the demo operator topology. Reports what **each kind** produced.
565
+ Previously seeding was reachable only as `deploy --seed`, because the platform's seed endpoint was
566
+ keyed on an install id, guarded platform-admin, and carried no tenant/project segments — so the
567
+ `/api/self/**` surface could not reach it and a `pack:deploy` token never could. Re-seeding meant
568
+ a full redeploy or asking an operator. Idempotent and cheap to re-run: records upsert, and
569
+ existing media is REUSED rather than regenerated, so a second pass reports zero images.
570
+
571
+ ## [0.4.0] - 2026-08-01
572
+
573
+ ### Added
574
+ - **`octwin projects create` / `octwin projects rm`** — a **disposable end-to-end environment** from
575
+ the CLI, which is what marketplace developers have been missing. `octwin deploy` has always needed
576
+ a project that already existed and the CLI could only *list* them, so standing up a throwaway
577
+ full deployment meant opening the console or asking an operator. Now:
578
+ ```bash
579
+ octwin projects create "Scratch" # → slug `scratch`
580
+ octwin deploy --project scratch --seed # publish + install + demo data
581
+ octwin chat "hi" --project scratch # talk to it (--script for a whole conversation)
582
+ octwin projects rm scratch --yes # throw it away
583
+ ```
584
+ A throwaway environment is deliberately **not a special kind of thing** — it is an ordinary
585
+ project in your own workspace, so it inherits your plan, entitlements, RBAC and teardown with no
586
+ separate lifecycle. `create` derives the URL slug from the name (`--slug` pins one, `--pack`
587
+ installs an already-published pack). `rm` is a HARD delete — the project and everything cascading
588
+ from it, no undo, not the same as archiving — so **without `--yes` it only prints what would be
589
+ destroyed**, making the dry run the default; the impact list is derived from `pg_constraint`, the
590
+ same payload the console's confirm dialog renders. Both need `projects:write`, which a
591
+ `pack:deploy` token does **not** confer — the CLI names that scope in the 403 hint.
592
+
593
+ ## [0.3.0] - 2026-07-31
594
+
595
+ ### Added
596
+ - **`octwin projects`** — the `--project <slug>` values your token can actually name, with the plan's
597
+ project cap. Every project-scoped command takes that flag and nothing printed the list, so an
598
+ author whose token was not pinned had to guess, and a wrong guess 404s identically to a project
599
+ that exists but has no install. `--archived` includes archived projects; `--json` for raw.
600
+ A `pack:deploy` token reaches it: the platform route was widened to accept `pack:deploy` alongside
601
+ `projects:read`, because `pack:deploy` is `access: 'special'` and confers nothing else — the
602
+ command would have 403ed for exactly the person it exists for.
603
+ - **`octwin validate --require-kb`** — turn a skipped KB-driven check into a failure, for CI.
604
+
605
+ ### Fixed
606
+ - **`octwin validate` printed ✓ with two of its three checks switched off.** The render-intent and
607
+ primitive-argument checks read `<packDir>/.octwin/platform-kb/`, joined onto the pack directory
608
+ EXACTLY — so an author who pulled once at a repo root and then worked in `packs/<name>/` had both
609
+ checks silently disabled, and the ✓ printed above them unconditionally while the per-check ✓s lived
610
+ inside the `if`s. An entire batch of platform-backlog entries reached production through that hole.
611
+ Three fixes: the KB is now found by **walking up** (one pull at a repo root covers every pack under
612
+ it, `src/lib/kb-path.ts`); the readers report **three states** — absent, malformed, ok — so a
613
+ half-written pull no longer reads as "you haven't pulled yet"; and a skip is **announced on the
614
+ last line printed**, because a caveat above a ✓ does not reach a reader who stopped at the ✓.
615
+ Warn-and-exit-0 stays the default (the KB is a gitignored cache and `platform-kb pull` needs
616
+ `pack:deploy`, so a hard failure would break a fresh clone) — the defect was the silence, not the skip.
617
+ - **`octwin status` said "live and current" for a pack that could not receive a message.** Every field
618
+ it printed was process-global: `registered` is true for a pack ANY project on that instance loaded.
619
+ Dispatch is per-project and takes the oldest ACTIVE install, ignoring the rest. The route now
620
+ filters `status = 'active'` (an archived install used to report live) and compares against the real
621
+ dispatch target, so status can say plainly that another pack owns this project's messages.
622
+ - **`octwin validate --remote --project does-not-exist` answered `{ ok: true }`** while `deploy` with
623
+ the same flag 404ed. The platform route resolves tenant and project before validating now.
624
+
625
+ ### Changed
626
+ - **`octwin validate --remote` also runs the platform's flow LINT.** It used to run only at pack load,
627
+ so a finding of severity `error` — an `assign:` whose value is a quoted literal, a `$t()` key with
628
+ no namespace — passed validate and failed the deploy. Offline `validate` cannot do this: the lint
629
+ needs a template-expanded `FlowDef`, which only the server builds.
630
+ - **`record_aggregate` / `record_group` now REQUIRE a scope** (`contact_id` or `all: true`) — a
631
+ platform contract change the offline arg check replays from the KB. Re-pull after upgrading.
632
+
633
+ ## [0.2.0] - 2026-07-30
634
+
635
+ ### Fixed
636
+ - **`records`, `cases`, `orders` and `catalog` printed a correct total and ZERO rows.** The platform
637
+ collapsed its eight per-domain list envelopes into one `Page<T>` whose collection key is `rows`;
638
+ the CLI still read `json.records` / `.cases` / `.orders` / `.products` behind a `?? []`, so the
639
+ fallback turned a key rename into an empty list instead of an error. `octwin records doctor`
640
+ reported *"5 record(s)"* and then *"(none — mint a `records:read` token …)"*, blaming the user's
641
+ credentials. All five readers now go through one `readPage` helper
642
+ (`src/lib/page.ts`) with a test pinned to the real envelope — a hand-copied key name in an
643
+ untested CLI is what shipped this, so the fix is the single reader, not five edits.
644
+ - **`--flag=value` silently did nothing.** `--limit=5` became the key `limit=5` and the command ran
645
+ with its default. Now parsed; `--set`/`--param` also accept repetition.
646
+ - **`octwin catalog` always printed `Products: 0`** — it counted the page, and the route's `total`
647
+ had never been read.
648
+
649
+ ### Added
650
+ - **Write commands — a pack author can now exercise the state their pack creates, not just read it.**
651
+ Every one needs the matching `:write` scope; a leading verb (`create`/`note`/`transition`/…) is
652
+ what distinguishes a write from the read that shares its command.
653
+ - `records create|patch|stage|note`, `records tasks`, `records task complete`
654
+ - `cases assign|note|transition|decide` — `decide --dry-run` previews the customer-facing copy and
655
+ resulting status **without committing** (that route needs only `cases:read`)
656
+ - `orders transition|refund` · `catalog availability|stock` · `agents set`
657
+ - `scheduling rules|rule add|rule rm|exception add|exception rm`
658
+ - **`octwin feedback`** submits the pack's `FEEDBACK.md` to the platform team, attaching the pack
659
+ version, this CLI's version and the `content_hash` of the capability reference you pulled — the two
660
+ facts that separate a real platform gap from something already fixed or a stale KB. Replaces
661
+ "hand the file to the platform team".
662
+ - **`--offset` on every list**, and a line saying when a list was truncated and what to run next.
663
+ `has_more` was on every response and no command surfaced it, so a partial list looked complete.
664
+
665
+ ### Changed
666
+ - `orders refund` **exits non-zero when the payment gateway refuses.** The route answers `200` with
667
+ the verdict in `gateway`, so reporting the HTTP status would tell an operator money moved when it
668
+ did not.
669
+ - A 403 on a record or case write now says it may be an **RBAC grant gap** rather than a missing
670
+ scope: the scope is checked on the token, then the verb is re-checked against that specific row.
671
+
672
+ ## [0.1.21] - 2026-07-30
673
+
674
+ > **Never published to npm.** Bumped in-repo, then superseded hours later by 0.2.0 — everything
675
+ > below ships as part of that release. Kept as its own section because the changes are distinct.
676
+
677
+ ### Added
678
+ - **`deploy` and `status` report the marketplace-listing verdict.** A manifest carrying
679
+ `listing.public: true` put the pack into an operator review queue, and the state existed only in
680
+ the console — so an author working from the CLI got no acknowledgement that the request had
681
+ registered, and never saw a rejection note (which the platform *requires* precisely because it is
682
+ their only feedback). Both commands now print it via `printPublicListing`, and stay silent for a
683
+ pack that never asked. `status` also distinguishes *approved* from *actually public*: an approval
684
+ pins the content sha it reviewed, so any edit returns the pack to the queue on its own.
685
+ - **`octwin pull` is discoverable.** It was implemented and answered `--help`, but appeared in
686
+ neither `octwin help` nor the README — the one command that recovers a deployed pack's only source
687
+ copy was invisible unless you already knew its name. Also added to the scope-requirement table, so
688
+ a 403 names `pack:deploy` instead of printing the generic hint.
689
+
690
+ ### Fixed
691
+ - **The capability-reference drift check no longer fails silently on a narrow token.** The `?meta=1`
692
+ poll needs `pack:deploy`, but it rides on every networked command — so an author inspecting data
693
+ with a `records:read`-only token got no drift signal at all, and a stale reference is exactly what
694
+ leads to inventing a primitive from memory. A 401/403 there now says so once.
695
+ - **README: casework is declared in `worklist.yaml`, not a `cases.yaml`.** That grammar was retired;
696
+ following the README produced a pack whose casework silently never loaded. `octwin media generate`
697
+ was also missing from the command table.
698
+ - **`records` no longer blames the plan for a route the plan does not gate.** `GET /xrm/entities`
699
+ carries only the scope guard, so a 403 on the entity list wrongly cited the `records` plan feature.
700
+
701
+ ### Removed
702
+ - **Unreachable rename branches in `init`.** The agent-id and `main`-flow renames sat behind
703
+ `--agent` / `--flow` options the CLI never parsed, against a template that ships no `main` flow —
704
+ both branches could never fire, and their patterns would have matched nothing if they had.
705
+
706
+ ## [0.1.20] - 2026-07-29
707
+
708
+ ### Added
709
+ - **`octwin validate` catches primitive arguments the platform would drop — offline, no token.** A
710
+ primitive takes the arguments it declares and silently ignored the rest, so an invented or
711
+ misspelled `args:` key deployed clean, ran clean, and simply did nothing: `record_list args: {
712
+ order: … }` (the argument is `sort`) never ordered, and `booking_cancel args: { booking_record_id:
713
+ … }` meant the REQUIRED `record_id` never arrived, so cancelling just failed. Validate now replays
714
+ the platform's contract from the pulled KB (`primitives/*.json` → `inputSchema`) and names the bad
715
+ argument, what the primitive takes, and any required argument that is missing. Scanning the 21
716
+ shipped marketplace packs found **ten** such errors across five packs. Keys are checked, values are
717
+ not — an `args:` value is normally an expression string resolved at runtime.
718
+ [`args-check.ts`](src/lib/args-check.ts).
719
+ - Silently skipped when the KB has not been pulled yet, like the render-intent check beside it.
720
+ - It cannot see inside a `use:` template body (expanding one is the platform's job) — `octwin
721
+ validate --remote` covers that case, and now also reports unreachable `$bind.<path>` reads and
722
+ `outputs:` port typos, which have no offline equivalent.
723
+
724
+ ## [0.1.19] - 2026-07-29
725
+
726
+ ### Added
727
+ - **`octwin validate` catches render-intent fields the platform would drop — offline, no token.** Each
728
+ render intent takes a fixed field set; a key outside it used to be swallowed at load and dropped at
729
+ render, with no error anywhere — just a card missing what the author wrote. Validate now replays the
730
+ platform's own contract from the pulled KB (`render-intents/*.json` → `allowed_keys`) and names the
731
+ bad field, the intent, and what is allowed. Scanning the 21 shipped marketplace packs found two real
732
+ instances in 223 intents: a `text_card` carrying `buttons` (the fallback's only escape button never
733
+ rendered) and a `list_picker` carrying a non-existent `group_by` (a whole mapper step feeding a
734
+ fabricated parameter). Silently skipped when the KB has not been pulled yet.
735
+
736
+ ### Changed
737
+ - **`octwin platform-kb pull` now explodes the reference and writes an `INDEX.md`.** A pull used to
738
+ write ~787 KB across 34 flat files — about 225k tokens, more than the pack being authored — so
739
+ finding one primitive meant reading a 122 KB catalog. Catalogs the platform describes as
740
+ enumerable are now written **one file per entry** (`primitives/record_list.json`,
741
+ `render-intents/carousel.json`, `declarations/xrm.json`, …), with `INDEX.md` mapping every doc and
742
+ all 171 entries to its file with a one-line summary. Reading one primitive went from ~38k tokens to
743
+ ~700. The layout comes from the platform (an `entries` descriptor on the bundle index) rather than
744
+ being hardcoded here, so this CLI keeps working against any platform version and a platform that
745
+ adds a catalog needs no CLI release. The pulled directory is cleared each pull, so a withdrawn
746
+ capability cannot linger as a file the authoring agent reads as current — its *contents* are
747
+ cleared rather than the directory itself, since on Windows a directory that is any shell's working
748
+ directory cannot be removed.
749
+
750
+ ## [0.1.18] - 2026-07-29
751
+
752
+ ### Fixed
753
+ - **The bundle collector and the platform's repo import disagreed about what a pack directory
754
+ contains.** `collectBundleFiles` had its own rule and kept three things the operator's GitHub
755
+ import drops: `*.ts`/`*.tsx`, `__snapshots__/` and `*.example`. Because the server rejects a
756
+ `.ts` outright, the same directory imported cleanly from GitHub and failed to deploy from
757
+ disk with `'…': executable code is not allowed` — an error blaming a file that was never
758
+ meant to ship (a snapshot test beside a flow, or the documented `xrm.yaml.example` template).
759
+ The rule now lives in a vendored `lib/pack-source.ts` beside the vendored validator, and a
760
+ parity test in the platform drives both copies over one table.
761
+
762
+ ### Removed
763
+ - **`pack.json` is gone — the saved login IS the deploy target.** The file had eroded to a single
764
+ field, `platform_url`, which `octwin login --url … --token …` already states; `tenant`/`project`
765
+ became optional overrides once deploy tokens started carrying their own tenant and project pin.
766
+ So it was a second home for a fact `login` knew, and it cost real things: a machine-specific file
767
+ committed into every pack repo, a four-link config-precedence chain to document, and an
768
+ exclusion rule duplicated in the bundler and the server (which had already drifted apart).
769
+ `octwin init` and `octwin pull` no longer write one, and nothing reads one. **A pack directory is
770
+ now pack content and nothing else** — the same repo deploys from any machine, and a pulled pack
771
+ redeploys with no flags.
772
+
773
+ ### Changed
774
+ - **`octwin login` now sets the default deploy target**, not just the token: it writes a
775
+ `default_url` key alongside the token in `~/.octwin/credentials.json`. Every command resolves
776
+ **flags → env (`PACK_PLATFORM_URL`/`PACK_TENANT`/`PACK_PROJECT`/`PACK_TOKEN`) → saved login**.
777
+ An existing credentials file simply has no `default_url` until the next `octwin login` — which is
778
+ exactly what the "no platform url" error now tells you to run. CI is unaffected (it passes
779
+ `PACK_PLATFORM_URL` + `PACK_TOKEN` as env and never had a `pack.json` — that file is retired).
780
+
781
+ ## [0.1.17] - 2026-07-27
782
+
783
+ ### Added
784
+ - **`octwin pull <packId>` — write a DEPLOYED pack's source back to disk.** The inverse of
785
+ `deploy`. A pack pushed with the CLI lived on the platform as an artifact the runtime served
786
+ but nothing could hand back, so its only source copy was the machine that pushed it. Pull it,
787
+ fix it, redeploy it. Writes a `pack.json` (retired in 0.1.18 — the saved login is now the
788
+ target) so the pulled directory redeploys where it came from; `--version` picks a version,
789
+ `--force` overwrites a non-empty dir. You may pull a pack
790
+ your tenant OWNS (an operator token pulls any) — a pack you merely installed is not yours to
791
+ read.
792
+ - **`octwin chat --script <file>` — drive a whole conversation from one invocation.** One turn per
793
+ line, in order, in a single process over a single SSE connection, waiting for each turn to settle
794
+ before sending the next. Blank lines and `#` comments are skipped; `tap:<id>` presses a rendered
795
+ row/button (the rest of the line is kept verbatim, since a tap id is itself colon-delimited),
796
+ `media:<path>` uploads a file, and `media:<path> | caption` attaches one.
797
+
798
+ This exists because **chaining invocations races the agent loop.** A turn ends on a quiet gap
799
+ (`TURN_SETTLE_MS`), which can arrive while the server-side loop is still running — so
800
+ `chat A && chat B` lets B's inbound land mid-turn, and the agent fills required fields with
801
+ placeholder text (`service_id: "service-id"`) or starts a second workflow run. Those look exactly
802
+ like flow bugs and cost a field author three separate investigations. The one-turn-per-invocation
803
+ rule is now stated in `chat --help` and the header usage as well.
804
+
805
+ ### Changed
806
+ - **`octwin deploy` reports the suspended runs it invalidated.** A redeploy rebuilds the pack's
807
+ tools, and in-flight flow runs live in those tools — so every suspended conversation is dropped.
808
+ The deploy prints `ⓘ N suspended run(s) invalidated` when N > 0, instead of leaving the author to
809
+ discover it as a `workflow_resume_stale` on the next tap.
810
+
811
+ ## [0.1.16] - 2026-07-26
812
+
813
+ ### Added
814
+ - **A pack can ship committed images.** `jpg`/`jpeg`/`png`/`webp`/`gif`/`pdf` files in your pack
815
+ directory now travel as a separate `blobs` half of the bundle (base64 on the wire, `bytea` in
816
+ storage) instead of being rejected as "not an allowed pack file type". Declare each one under the
817
+ manifest's `static_assets: [{ file, key }]` and reference it from `config:` with the
818
+ `$pack_asset:<key>` sentinel — the platform uploads it to the media system at install and the
819
+ sentinel resolves to the served URL. `octwin validate` reports the image count alongside the file
820
+ count.
821
+ - **The size ceilings fail locally, before upload** — 2 MB per file, 32 MB of binary per pack,
822
+ mirroring the server. `svg` stays rejected: it is script-capable and these assets are served to
823
+ browsers.
824
+
825
+ ### Fixed
826
+ - **Committed images were silently corrupted.** `collectBundleFiles` read *every* file with
827
+ `readFileSync(full, 'utf8')`, so a JPEG went through a lossy UTF-8 decode and arrived mangled
828
+ server-side — a deploy that "succeeded" and rendered a broken image. Binary files now split off
829
+ into `blobs` and keep their bytes.
830
+ - **`octwin status` reported `loaded=(none)` for every pack, always.** It printed a `loaded_version`
831
+ field that stopped existing when reload moved to content-sha keying, which also meant the
832
+ version-drift warning underneath it could never fire. It now prints the **content sha** the
833
+ instance has loaded and the one the catalog holds (with the artifact's `origin`), and warns off the
834
+ platform's own `up_to_date` flag. The sha is the more useful fact anyway: re-publishing the *same*
835
+ version changes it, which is exactly the author's inner loop. A pack that is live and current but
836
+ **withdrawn** from the catalog now says so, rather than reporting a clean bill of health.
837
+
838
+ ## [0.1.15] - 2026-07-25
839
+
840
+ ### Added
841
+ - **`octwin agents [packId::agentId] [--prompt]` — see what your agent actually runs as.** The platform
842
+ gained *governed* agent settings: an operator platform default can override the `default_model`
843
+ (and history window / working-memory toggle) your manifest declares, and that override is invisible
844
+ from the pack source. The command prints each governed setting's **effective** value, **which layer
845
+ won** (project override → platform default → pack manifest), and warns explicitly when your pack's
846
+ declared value is *not* in force. `--prompt` prints the exact system prompt the LLM sees for this
847
+ project (pack instructions + platform protocol + any project overlay).
848
+ - **`octwin orders [reference_id]` — the commerce a conversation produced.** The list (number,
849
+ status/payment, total, contact) or one order with its line items, the
850
+ subtotal/tax/shipping/discount/total breakdown, `payment_ref`, and the allowed transitions. On a
851
+ `pending`/`none` payment it explains *why that's expected*: the forward payment lifecycle is
852
+ **webhook-owned** (not patchable), and the default gateway-less `manual` driver makes
853
+ `payment_request` take its `empty` port — so the flow should confirm pay-on-delivery, not error.
854
+ - **`octwin analytics [entity]` — stage conversion for any pipelined entity.** The funnel engine that
855
+ powered journeys is now generic, so any entity declared with a `pipeline:` charts conversion +
856
+ drop-off (`--overview` / `--milestones` / `--trends` / `--cost`, and `--stage <id>` for the records
857
+ currently at a stage). An empty result names **both** causes the platform folds into one response —
858
+ no `pipeline:`, or no `view` grant on `record.<entity>`.
859
+ - **`octwin catalog [--readiness]`** — commerce products with price, availability and stock
860
+ (`untracked` when the SKU isn't inventory-tracked), plus the WhatsApp catalog binding.
861
+ `--readiness` runs the Meta Graph checklist with each failing item's suggested fix.
862
+ - **`octwin scheduling [--slots <resourceRecordId>]`** — the engine state (bookable resource types,
863
+ upcoming slots, booked seats) or the computed slots for one resource. This is how you verify the
864
+ availability rules a `deploy --seed` created, which 0.1.14 could create but not read back.
865
+
866
+ ### Changed
867
+ - **Auth failures now name the scope the command needs.** Every 401/403 appends the required scope
868
+ (and the plan feature, where the route is entitlement-gated) from one client-side mirror of the
869
+ platform's scope registry — replacing the per-command hardcoded strings, several of which named no
870
+ scope at all. It also spells out that `pack:deploy` / `media:generate` are direct-grant only, so a
871
+ `tenant:admin` preset token does **not** confer them (the most common "but my token is admin" dead end).
872
+
873
+ ## [0.1.14] - 2026-07-23
874
+
875
+ ### Fixed
876
+ - **A failed demo seed no longer reports a clean `✓`.** `deploy` softens non-fatal
877
+ install steps (e.g. a demo-seed row) to warning frames, but the summary still printed
878
+ `✓ Deployed` and exited 0 — so a deploy that seeded ZERO records read as success (the
879
+ false-✓ trap). `deploy` now collects those step errors, prints `⚠ Deployed with N
880
+ warning(s) — data may be incomplete` with each message, and exits non-zero so CI /
881
+ a `deploy && chat` chain catches it.
882
+
883
+ ### Added
884
+ - **`login` echoes what the token reaches.** After saving, `octwin login` calls
885
+ `/api/self/t/whoami` and prints the workspace, project pin, and scopes — so a fresh
886
+ token self-identifies without a second `octwin whoami` (best-effort; a network failure
887
+ never fails the save).
888
+ - **`validate --remote` surfaces warnings + the data-store trap.** The remote validate now
889
+ renders advisory `⚠` warnings (which don't block deploy) and, for a pack declaring
890
+ `required_adapters: [data-store]`, reports the missing-data-store error the deploy would
891
+ have 409'd on — plus a warning that an `xrm.yaml` pack usually shouldn't declare that
892
+ adapter at all. It also now catches (offline) a list-form `entities:` block and a
893
+ `localized: true` field seeded with a bare string — traps that previously surfaced only
894
+ mid-seed at deploy.
895
+
896
+ ## [0.1.13] - 2026-07-22
897
+
898
+ ### Added
899
+ - **A headless media loop — produce + send.** Two paired additions close the coverage hole where any
900
+ media-collect flow (e.g. `activate-app`'s registration / ID uploads) stalled at the upload prompt
901
+ because the CLI could neither *make* nor *send* an image:
902
+ - `octwin media generate "<prompt>" [--out <file.png>] [--size 1024x1024] [--json]` — AI-generates an
903
+ image on the platform (needs a `media:generate`-scoped token), stores it as a public asset, and prints
904
+ its `MEDIA-` handle + serve URL. `--out` downloads the bytes to a file (WhatsApp renders only
905
+ `.png`/`.jpg`); `--json` emits `{ media_id, url, mime, width, height, bytes }`.
906
+ - `octwin chat --media <file|media-id>` — uploads a local file (or a media id from
907
+ `media generate --json`) as an image/document/audio inbound; any accompanying `"message"` rides as
908
+ its caption. The platform's media pipeline folds the upload into a running collect, so media flows
909
+ are now fully drivable headlessly.
910
+
911
+ ### Changed
912
+ - **The KB-drift nudge now names what changed.** With the platform serving per-entry content hashes, the
913
+ post-command nudge appends a `(N changed · M added · K removed)` summary instead of a bare hash pair.
914
+ - **`octwin platform-kb` prints a changelog on pull.** Instead of only a doc/catalog count, the pull now
915
+ diffs the fresh index against your last pull and lists exactly which docs/catalogs were added (`+`),
916
+ changed (`~`), or removed (`-`) — so a replaced schema shape is visible, not silent.
917
+
918
+ ## [0.1.12] - 2026-07-22
919
+
920
+ ### Fixed
921
+ - **The KB-drift nudge now fires after `chat` too.** `chat` — the command a debugging session runs most —
922
+ was missing from the networked-command list, so a chat-heavy session never noticed the platform's
923
+ capability reference had moved. The nudge also now shows the concrete drift
924
+ (`old-hash → new-hash`) so you can see it's real, not a heuristic.
925
+
926
+ ### Changed
927
+ - **Every networked command announces what it's doing before it does it.** `chat` prints
928
+ `→ Connecting to <tenant>/<project> as '<handle>' …` before opening the stream and
929
+ `… delivered — waiting for the reply (up to Ns)` after the send; `status` / `whoami` /
930
+ `platform-kb` / `records` / `logs` / `cases` each print a one-line `→ …` header naming the
931
+ action and target before the first network call — no more silent seconds followed by a result
932
+ (or a hang with no clue what was being attempted). JSON modes (`--json`) stay clean for piping.
933
+
934
+ ## [0.1.11] - 2026-07-21
935
+
936
+ ### Fixed
937
+ - **Auth-failure hint on every command, not just the inspect family** (author-feedback A7). `validate`,
938
+ `deploy`, `status`, and the single-record read now print the scope/transient explanation on a 401/403
939
+ (the shared `authFailureHint`), instead of a bare `HTTP 401` that left it ambiguous whether the token
940
+ lacked a scope or the platform hiccupped.
941
+
942
+ ## [0.1.10] - 2026-07-21
943
+
944
+ The capability reference is now **pulled, never bundled** — the authoring skill dropped its committed KB
945
+ snapshot, so `octwin platform-kb pull` is the single source of truth, and the CLI watches it for drift.
946
+
947
+ ### Added
948
+ - **KB-drift nudge** — after any command that already talks to the platform (`deploy` / `status` /
949
+ `test` / `validate --remote` / `records` / `cases` / `logs` / `whoami`), the CLI does one tiny
950
+ `octwin-platform-kb?meta=1` GET and prints a one-line "the platform capability reference changed —
951
+ `octwin platform-kb pull`" when the platform's `content_hash` no longer matches your last pull.
952
+ Fail-silent + TTY-only + no-op until you've pulled once — the sibling of the existing CLI-upgrade notice.
953
+
954
+ ### Changed
955
+ - **`octwin platform-kb pull`** now records the reference's `content_hash` in `.octwin/platform-kb/index.json`
956
+ (the fingerprint the drift check compares against).
957
+
958
+ The conversation-debugging release — driven by the second author-feedback round (xpeng-egypt),
959
+ which found the author→validate→deploy loop solid but multi-turn debugging impossible from the CLI.
960
+
961
+ ### Added
962
+ - **`octwin chat --tap "<tap-id>"`** — press a rendered button / list row (sends the web channel's
963
+ `type:'interactive'` inbound). Paired with full render printing, any tap-driven flow is now drivable headlessly.
964
+ - **Full render printing** — every reply prints its complete interactive content: list sections/rows,
965
+ buttons, and carousel cards, each with its **tap id**; header/footer/list-button text included.
966
+ - **`--json` on `chat` / `logs` / `cases`** — raw SSE envelopes (chat) or raw event/case payloads.
967
+ - **`octwin cases [caseId] [--queues]`** — inspect casework (support tickets): the inbox, one case +
968
+ timeline + applicable decisions, or queue keys with open counts. Casework packs previously had zero
969
+ data-inspection path (`records case` was a dead end).
970
+ - **Per-subcommand `--help`/`-h`** — intercepted before any network or auth work (previously
971
+ `octwin logs --help` made a network call and could die with a 401).
972
+ - Multi-message turns: `chat` now collects **all** of a turn's renders (quiet-gap detection) instead
973
+ of cutting at the first one.
974
+
975
+ ### Changed
976
+ - **`octwin logs`**: the conversation list shows contact handle + last activity and filters with
977
+ `--as <handle>`; the timeline prints **full** event text (no more 240-char truncation) plus the
978
+ renders each turn actually sent; footer points at `--json` / `mastra-messages` for verbatim payloads.
979
+ - **Network failures name the target URL** (`platform unreachable at <url>`), and 401s explain
980
+ invalid-token vs one-off transient instead of a bare status code.
981
+ - `octwin records` on an unknown entity now surfaces the server's error body, and for `case`/`cases`
982
+ points at `octwin cases`.
983
+
984
+ ### Fixed
985
+ - **Multi-turn chat actually works.** Two bugs made consecutive `octwin chat` calls look like "every
986
+ call starts fresh": (1) the idempotency `local_id` was a **constant** per handle, so the platform's
987
+ 5-minute inbound dedup silently dropped the second message — a fresh id is now minted per call;
988
+ (2) a fresh SSE connect **replays** recent history and the CLI printed the first render frame — i.e.
989
+ the *previous* turn's greeting — as the reply; the CLI now drains the replay and only accepts frames
990
+ newer than the connect boundary. The platform always kept one open conversation per `--as` handle —
991
+ the same handle genuinely continues the same conversation now.
992
+
993
+ ## [0.1.8] - 2026-07-21
994
+ - Global-first install guidance (`npm i -g octwin-cli`); upgrade notice suppressed under `npx`.
995
+
996
+ ## [0.1.7] - 2026-07-21
997
+ - `--version`/`-v` flag; daily fail-silent, TTY-only "newer version available" notice.
998
+
999
+ ## [0.1.6] - 2026-07-21
1000
+ - `octwin init` scaffolds a home-hub menu (`home` list_picker + example `browse` tool) instead of a bare greeting.
1001
+
1002
+ ## [0.1.5] - 2026-07-20
1003
+ - `octwin validate --remote` (the platform's FULL manifest + flow-DSL check, all errors at once);
1004
+ headless debugging commands `octwin records` / `octwin logs` / `octwin chat`; `octwin test` became
1005
+ an alias for `validate --remote`. First author-feedback round.
1006
+
1007
+ ## [0.1.4] - 2026-07-20
1008
+ - Authoring reliability + DX fixes from the first end-to-end external-pack test.
1009
+
1010
+ ## [0.1.3] - 2026-07-20
1011
+ - `octwin platform-kb pull` — pull the platform capability reference for the authoring skill.
1012
+
1013
+ ## [0.1.2] - 2026-07-20
1014
+ - Proper npm README.
1015
+
1016
+ ## [0.1.1] - 2026-07-20
1017
+ - Initial npm publish: `init` / `validate` / `login` / `whoami` / `deploy` / `status`, `oct_` deploy tokens.