@sylphx/cli 0.10.0 → 0.12.1

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,5 +1,68 @@
1
1
  # @sylphx/cli
2
2
 
3
+ ## 0.12.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1172](https://github.com/SylphxAI/platform/pull/1172) [`c14a894`](https://github.com/SylphxAI/platform/commit/c14a894e9a3792a4f491f3acff3517008355e35f) Thanks [@shtse8](https://github.com/shtse8)! - Harden OAuth refresh for local agent fleets: stale refresh-token rejection no longer clears a newer stored session, refresh outages now surface as transient failures instead of hidden logouts, and handled CLI auth errors no longer print Effect runtime stack noise.
8
+
9
+ ## 0.12.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#1126](https://github.com/SylphxAI/platform/pull/1126) [`b5c6c14`](https://github.com/SylphxAI/platform/commit/b5c6c142ba89078edf460807282337dc315b77df) Thanks [@shtse8](https://github.com/shtse8)! - ADR-141..146 — health observability stack lands across the SDK, CLI, contract, and management surfaces.
14
+
15
+ ## `@sylphx/sdk` (`@sylphx/sdk/health`) — new public surface
16
+
17
+ - **`withHealth.{hono,express,fastify,fetch}`** — framework-agnostic Zero-Config `/healthz` middleware. Drop one line into your Hono / Express / Fastify / Next.js / Bun.serve app and you get a multi-signal continuous-score health endpoint, OTel emission, causality propagation, and audit-grade history out of the box.
18
+ - **Seven built-in signals**: `eventLoopLagSignal`, `queueDepthSignal`, `errorRateSignal`, `memoryPressureSignal`, `pingSignal`, `databaseSignal`, `redisSignal`. Compose them via `sylphxHealth({ signals: [...] })`; the default scoring strategy is weighted geometric mean per ADR-111 §4.5.
19
+ - **ADR-142 OTel-native emission** — `health.score`, `health.signal.factor`, `health.signal.value`, `health.signal.value_state`, `health.downstream_cause` metrics + `service.health.*` span attributes + `health.evaluated` event. Default-on; graceful no-op when `@opentelemetry/api` is not installed.
20
+ - **ADR-143 causality propagation** — read/write OTel Baggage entries `sylphx.health.cause` + `sylphx.health.cause_chain`. A Postgres outage produces one paged alert at the root plus N silent downstream-impact rows, not 12 red dots. Default-on with a 0.5 score threshold.
21
+ - **ADR-144 audit-grade history** — every `evaluate()` produces a SHA-256 prev-hash chained `HistoryEntry` (CloudTrail-style integrity), retrievable via `getHistory(query?)` / verifiable via `verifyHistory(query?)`. Pluggable `HistoryStore` interface; in-memory ring buffer is the reference implementation.
22
+
23
+ ## `@sylphx/cli`
24
+
25
+ - **`sylphx migrate health-checks`** — idempotent codemod that wires `withHealth.*` into your app's entry file (Hono / Express / Fastify / Next.js auto-detected) and removes hand-rolled `/health` + `/ready` routes. Supports `--dry-run` and `--check` (CI-grade exit-1-on-pending).
26
+ - **`sylphx migrate status`** — per-service fleet visibility. Queries the Management API for every visible project and reports which services have `frameworkSignals.sdkHealthDetected = true`. The answer to "which of my services still need ADR-141?".
27
+ - **`sylphx health verify --file <path>`** — offline verifier for an exported ADR-144 history chain. Walks the SHA-256 chain and reports the first break with a clear reason. Mirrors AWS CloudTrail `validate-logs`.
28
+
29
+ ## `@sylphx/management` + `@sylphx/contract`
30
+
31
+ - **`TriggerDeploymentInput.frameworkSignals`** — optional map of `service slug → { sdkHealthDetected?: boolean }`. The CLI now scans `package.json` at deploy time and forwards these signals; the Management API merges them into `project_services.machine_config.frameworkSignals` before the reconciler picks up the deploy. Used by the reconciler smart-default (HTTP `/healthz` probe when the SDK is detected) and by the new ADR-111 Phase B sidecar SDK-detection gate.
32
+ - **`Service.frameworkSignals`** — new read-only field on the Service response so `sylphx migrate status` can render the fleet scorecard.
33
+
34
+ ## Why upgrade
35
+
36
+ Every Sylphx service gets the SOTA dataplane for free — continuous score in `[0, 1]`, multi-signal composition, OTel-native observability, causality-aware alert routing, audit-grade evidence, and (post-ADR-111 Phase B sidecar) automatic drain/kill enforcement. The legacy `/live` + `/ready` split-probe pattern is retired in a single migration.
37
+
38
+ See `docs/how-to/health-checks.md`, `docs/explanation/health-check-ownership.md`, and the runbook `docs/runbooks/health-alert-routing-adr143.md` for the operator surface.
39
+
40
+ ### Patch Changes
41
+
42
+ - Updated dependencies [[`b5c6c14`](https://github.com/SylphxAI/platform/commit/b5c6c142ba89078edf460807282337dc315b77df)]:
43
+ - @sylphx/sdk@0.13.0
44
+
45
+ ## 0.11.0
46
+
47
+ ### Minor Changes
48
+
49
+ - [#1105](https://github.com/SylphxAI/platform/pull/1105) [`ab0491b`](https://github.com/SylphxAI/platform/commit/ab0491b892ecb9e96eb2843d2b6519f8eb52e3c9) Thanks [@shtse8](https://github.com/shtse8)! - ADR-137 §2.3 / §2.4 — per-PR cost browser, step 2 (API + SDK + CLI).
50
+
51
+ - **API**: `GET /projects/:id/previews/:prNumber/cost` returns a per-PR cost envelope (build / preview env / BaaS breakdown + 30-day project monthly-average comparison). `GET /projects/:id/previews/cost` lists the most recent 50 PRs (cursor paginated by `(prNumber, windowOpenedAt)`). Both require `project:read`.
52
+ - **SDK** (`@sylphx/management`): new `previews.cost(client, projectId, prNumber, opts?)` and `previews.listCosts(client, projectId, opts?)` capability namespace.
53
+ - **CLI** (`@sylphx/cli`): new `sylphx previews cost <pr-number>` and `sylphx previews list-costs [--project <slug>]` subcommands. Headline cost is coloured by comparison ratio (green < 1×, yellow 1–2×, red ≥ 2×) per ADR-137 §2.5.
54
+
55
+ No DB migration. Cost math reuses the aggregator landed in ADR-137 Step 1 (#1092).
56
+
57
+ - [#1090](https://github.com/SylphxAI/platform/pull/1090) [`7493f41`](https://github.com/SylphxAI/platform/commit/7493f41af30f565428f0335c6c6c3a491065c89d) Thanks [@shtse8](https://github.com/shtse8)! - Fail loudly on SSE log-stream transport failures instead of silently switching `sylphx deploy` to deployment polling. Deployment state remains available through explicit `sylphx deployments get` and `sylphx deployments wait` commands.
58
+
59
+ ### Patch Changes
60
+
61
+ - [#1097](https://github.com/SylphxAI/platform/pull/1097) [`7065be6`](https://github.com/SylphxAI/platform/commit/7065be6ccf978f76e8e2e518bf57f7e144e3954e) Thanks [@shtse8](https://github.com/shtse8)! - Validate configured CLI credentials in `sylphx doctor` with a read-only Management API principal check so revoked or expired agent tokens fail loudly instead of appearing logged in.
62
+
63
+ - Updated dependencies []:
64
+ - @sylphx/sdk@0.12.3
65
+
3
66
  ## 0.10.0
4
67
 
5
68
  ### Minor Changes
package/README.md CHANGED
@@ -46,7 +46,7 @@ The CLI supports three auth paths (ADR-059 + ADR-074):
46
46
 
47
47
  Legacy `slx_*` personal access tokens were eliminated 2026-04-21 (ADR-059 §1.4) and are no longer accepted by the API.
48
48
 
49
- Under ADR-059, OAuth tokens are stored as an atomic `{ accessToken, refreshToken, expiresAt, refreshExpiresAt }` record with mode `0600` on disk. The refresh interceptor (`utils/oauth-refresh.ts`) transparently rotates the access token when it's within the refresh window; a failed refresh prompts re-login.
49
+ Under ADR-059, OAuth tokens are stored as an atomic `{ accessToken, refreshToken, expiresAt, refreshExpiresAt }` record with mode `0600` on disk. The refresh interceptor (`utils/oauth-refresh.ts`) transparently rotates the access token when it's within the refresh window. Reuse/expiry clears only the rejected refresh-token chain; refresh transport failures are reported as outages and never silently erase the stored login.
50
50
 
51
51
  ```bash
52
52
  # Interactive (developers)