@arnilo/prism 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/CHANGELOG.md +28 -1
  2. package/dist/agent-loops.d.ts +1 -0
  3. package/dist/agent-loops.js +26 -16
  4. package/dist/agents.js +2 -3
  5. package/dist/contracts.d.ts +2 -0
  6. package/dist/ids.d.ts +2 -0
  7. package/dist/ids.js +6 -0
  8. package/dist/index.d.ts +5 -1
  9. package/dist/index.js +3 -1
  10. package/dist/session-stores.js +2 -3
  11. package/dist/testing/persistence-schema.d.ts +45 -7
  12. package/dist/testing/persistence-schema.js +138 -24
  13. package/dist/thinking.d.ts +42 -0
  14. package/dist/thinking.js +92 -0
  15. package/dist/tools.js +2 -3
  16. package/dist/use-case-model.d.ts +63 -0
  17. package/dist/use-case-model.js +52 -0
  18. package/docs/a2a.md +4 -2
  19. package/docs/agent-events.md +10 -15
  20. package/docs/agent-loops.md +11 -8
  21. package/docs/coding-agent-tools.md +33 -12
  22. package/docs/coding-security.md +2 -2
  23. package/docs/compaction-llm.md +17 -7
  24. package/docs/compaction-observational-memory.md +28 -4
  25. package/docs/credential-storage.md +58 -9
  26. package/docs/credentials-and-redaction.md +1 -1
  27. package/docs/database-persistence.md +8 -3
  28. package/docs/host-security.md +10 -6
  29. package/docs/index.md +23 -20
  30. package/docs/mcp-tools.md +26 -10
  31. package/docs/migration.md +146 -2
  32. package/docs/node-filesystem-config.md +1 -0
  33. package/docs/node-jsonl-session-store.md +5 -4
  34. package/docs/postgres-persistence.md +3 -3
  35. package/docs/provider-caching.md +16 -4
  36. package/docs/provider-conformance.md +39 -1
  37. package/docs/provider-packages.md +60 -3
  38. package/docs/providers/ai-sdk.md +36 -0
  39. package/docs/providers/kimi.md +124 -61
  40. package/docs/providers/neuralwatt.md +19 -13
  41. package/docs/providers/openai.md +56 -13
  42. package/docs/providers/opencode-go.md +118 -30
  43. package/docs/providers/openrouter.md +105 -35
  44. package/docs/providers/zai.md +94 -45
  45. package/docs/release-and-install.md +47 -49
  46. package/docs/review-coverage-2026-07-17-provider-validation.md +192 -0
  47. package/docs/runs-and-usage.md +1 -1
  48. package/docs/sqlite-persistence.md +2 -2
  49. package/docs/structured-output.md +1 -1
  50. package/docs/thinking-and-reasoning.md +98 -0
  51. package/docs/tool-execution-primitives.md +3 -3
  52. package/docs/tools.md +15 -0
  53. package/docs/use-case-model-selection.md +109 -0
  54. package/docs/workflow-orchestration-primitives.md +1 -0
  55. package/docs/workflows.md +17 -10
  56. package/docs/working-and-semantic-memory.md +1 -0
  57. package/package.json +2 -2
@@ -1,62 +1,85 @@
1
- # ZAI provider package
1
+ # Z.AI provider package
2
2
 
3
3
  ## What it does
4
4
 
5
- `@arnilo/prism-provider-zai` provides explicit, side-effect-free setup for the ZAI GLM
6
- API-key provider using Prism's OpenAI-compatible route with the
7
- `thinkingFormat: "zai"` model-compat setting, developer-role fallback, and
8
- GLM tool-stream quirks.
5
+ `@arnilo/prism-provider-zai` provides explicit, side-effect-free setup for the Z.AI
6
+ GLM Chat Completions API (`POST /chat/completions`) with official deep-thinking,
7
+ reasoning-effort, and tool-stream request fields.
9
8
 
10
- The package registers a provider, default model metadata, and an `api_key` auth
11
- method through `createExtensionKernel().load([...])`.
9
+ The package registers a provider, featured GLM model metadata, and an `api_key`
10
+ auth method through `createExtensionKernel().load([...])`.
12
11
 
13
12
  ## When to use it
14
13
 
15
- Use it when a host app wants to run the ZAI GLM endpoint through Prism's
16
- `AgentSession` runtime with ZAI-specific thinking/tool-stream handling.
14
+ Use it when a host app wants to run Z.AI GLM models through Prism's
15
+ `AgentSession` runtime with official `thinking` / `reasoning_effort` /
16
+ `tool_stream` mapping and implicit context caching.
17
17
 
18
- Do not use it for automatic credential discovery, catalog fetches, or
18
+ Do not use it for automatic credential discovery, setup-time catalog fetches, or
19
19
  real-network tests.
20
20
 
21
21
  ## Inputs / request
22
22
 
23
23
  ```ts
24
- import { createZaiProviderPackage } from "@arnilo/prism-provider-zai";
24
+ import {
25
+ createZaiProviderPackage,
26
+ defineZaiModel,
27
+ listZaiModels,
28
+ } from "@arnilo/prism-provider-zai";
25
29
 
26
30
  createZaiProviderPackage(options: ZaiProviderPackageOptions): ProviderPackage
27
- defineZaiModel(config: ZaiModelConfig): ZaiModelConfig
31
+ defineZaiModel(config: ZaiModelConfig): ModelConfig
32
+ listZaiModels(options?: ListZaiModelsOptions): Promise<ModelConfig[]>
28
33
  ```
29
34
 
30
35
  | Field | Type | Purpose |
31
36
  | --- | --- | --- |
32
37
  | `apiKey` | `CredentialValueSource` | Direct/callback/resolver API-key source. |
33
38
  | `fetch` | `typeof fetch` | Optional fetch implementation for tests/hosts. |
34
- | `baseUrl` | `string` | Overrides the ZAI base URL. |
39
+ | `baseUrl` | `string` | Overrides the Z.AI base URL (default `https://api.z.ai/api/paas/v4`). |
35
40
  | `id` | `string` | Overrides the provider id (default `zai`). |
36
- | `models` | `readonly ModelConfig[]` | Overrides `zaiModels` defaults. |
41
+ | `models` | `readonly ModelConfig[]` | Overrides featured `zaiModels` defaults. |
37
42
 
38
- `ModelConfig.compat.thinkingFormat: "zai"` enables ZAI thinking handling;
39
- `developerRoleFallback` controls developer-role fallback.
43
+ ### Thinking / reasoning compat
44
+
45
+ Official body fields (request `options.compat` wins over `model.compat`):
46
+
47
+ | Compat / body field | Wire shape | Notes |
48
+ | --- | --- | --- |
49
+ | `thinking` | `boolean` or `{ type: "enabled" \| "disabled", clear_thinking?: boolean }` | Boolean `true`/`false` maps to `{ type: "enabled" }` / `{ type: "disabled" }`. |
50
+ | `reasoning_effort` | string | GLM-5.2+: `max` (default) \| `xhigh` \| `high` \| `medium` \| `low` \| `minimal` \| `none`. |
51
+ | `tool_stream` | boolean | GLM-4.6+: stream tool-call argument deltas (`false` by API default; featured 4.6+ models opt in). |
52
+ | `clear_thinking` | boolean | Nested into `thinking.clear_thinking`. Default on the API is `true` (drop prior reasoning). Set `false` for Preserved Thinking. |
53
+ | `preserveThinking` | boolean | Prism-local: when true (or when `clear_thinking: false`), replay prior thinking blocks as assistant `reasoning_content`. |
54
+
55
+ `ProviderRequestOptions.cacheRetention: "none"` forces `thinking: { type: "disabled" }`.
56
+
57
+ Shared Prism helpers (`applyThinkingLevel` / `thinkingFamilyForModel`) map portable
58
+ levels into the `reasoning_effort` family for Z.AI; hosts can also set
59
+ `thinking.type` directly for enable/disable.
40
60
 
41
61
  ## Outputs / response / events
42
62
 
43
63
  | Surface | Behavior |
44
64
  | --- | --- |
45
- | Provider stream | Prism text, thinking (preserved only when `model.compat.preserveThinking` is true, otherwise downgraded to text), tool-call delta/final, `usage`, `done`, redacted `error`. |
46
- | Block preservation | Text, thinking, assistant `tool_call` → `tool_calls`, `tool_result` → role `tool` messages, images when `capabilities.input` includes `"image"`. |
65
+ | Provider stream | Prism text, thinking (`delta.reasoning_content`), tool-call delta/final, `usage`, `done`, redacted `error`. |
66
+ | Block preservation | Text; thinking → `reasoning_content` when Preserved Thinking is active (otherwise dropped, never flattened into text); assistant `tool_call` → `tool_calls`; `tool_result` → role `tool`; images when `capabilities.input` includes `"image"`. |
47
67
  | Auth method | `api_key` for the configured provider id, credential name `apiKey`. |
48
68
 
49
69
  Unsupported block placements or unclaimed images fail before fetch.
50
70
 
51
71
  ## Request/response example
52
72
 
53
- Example request body (OpenAI-compatible Chat Completions shape):
73
+ Example request body (official Chat Completions shape):
54
74
 
55
75
  ```json
56
76
  {
57
- "model": "glm-4.6",
77
+ "model": "glm-5.2",
58
78
  "messages": [{ "role": "user", "content": "Hello" }],
59
- "stream": true
79
+ "stream": true,
80
+ "thinking": { "type": "enabled" },
81
+ "reasoning_effort": "max",
82
+ "tool_stream": true
60
83
  }
61
84
  ```
62
85
 
@@ -64,63 +87,89 @@ Example request body (OpenAI-compatible Chat Completions shape):
64
87
 
65
88
  ```ts
66
89
  import { createExtensionKernel } from "@arnilo/prism";
67
- import { createZaiProviderPackage } from "@arnilo/prism-provider-zai";
90
+ import { createZaiProviderPackage, listZaiModels } from "@arnilo/prism-provider-zai";
68
91
 
69
92
  const kernel = createExtensionKernel();
70
93
  await kernel.load([createZaiProviderPackage({ apiKey: "fake-zai-key" })]);
94
+
95
+ // Optional caller-gated discovery (never runs during package setup):
96
+ const live = await listZaiModels({ apiKey: "fake-zai-key" });
97
+ await kernel.load([createZaiProviderPackage({ apiKey: "fake-zai-key", models: live })]);
71
98
  ```
72
99
 
73
- Override the provider id and models:
100
+ Per-turn thinking override:
74
101
 
75
102
  ```ts
76
- import { createZaiProviderPackage, defineZaiModel, zaiModels } from "@arnilo/prism-provider-zai";
77
-
78
- await kernel.load([
79
- createZaiProviderPackage({ id: "zai", apiKey: "fake", models: zaiModels }),
80
- ]);
103
+ await session.prompt("Plan the refactor", {
104
+ providerOptions: {
105
+ compat: {
106
+ thinking: { type: "enabled", clear_thinking: false },
107
+ reasoning_effort: "high",
108
+ tool_stream: true,
109
+ },
110
+ },
111
+ });
81
112
  ```
82
113
 
83
114
  ## Extension and configuration notes
84
115
 
85
- - Hosts choose base URL, provider id, model list, credential source, and `fetch`
86
- impl.
87
- - `defineZaiModel` lets apps set ZAI-specific `compat` (thinking format, developer
88
- fallback).
89
- - Package contributes models via the extension `api` and an `api_key` auth method.
116
+ - Default base URL is the official international endpoint
117
+ `https://api.z.ai/api/paas/v4`. Hosts targeting China can pass
118
+ `baseUrl: "https://open.bigmodel.cn/api/paas/v4"`. Coding Plan hosts may use
119
+ `https://api.z.ai/api/coding/paas/v4`.
120
+ - Featured `zaiModels` are offline bootstrap aliases (`glm-5.2`, `glm-5.1`,
121
+ `glm-5`, `glm-5-turbo`, `glm-4.7`, `glm-4.6`, `glm-4.5`) curated from the
122
+ official Chat Completions model enum and overview context sizes.
123
+ - `listZaiModels()` is caller-gated OpenAI-compatible `GET /models` discovery
124
+ (not a first-class docs.z.ai list page). Setup never fetches.
125
+ - `defineZaiModel` sets Z.AI-specific `compat` (`thinking`, `reasoning_effort`,
126
+ `tool_stream`, `clear_thinking`, `preserveThinking`).
90
127
 
91
128
  ### Cache behavior
92
129
 
93
130
  - Z.AI GLM models use **implicit context caching**: the server caches prompt
94
131
  prefixes automatically based on request content, with no explicit request-side
95
132
  cache payload. Catalog models declare `cache: { kind: "implicit" }`.
133
+ - Official docs: hits appear in `usage.prompt_tokens_details.cached_tokens`.
96
134
  - The provider sends no `cache_control`, `prompt_cache_key`, `prompt_cache_retention`,
97
135
  or other explicit cache-control fields regardless of `ProviderRequestOptions.cache`
98
136
  / `cacheKey` / `cacheRetention` settings — those options have no effect on the
99
- Z.AI request body. Hosts relying on cache hits should keep their stable prompt
100
- prefix byte-stable and stable inputs unchanged.
101
- - Usage accounting is preserved: `prompt_tokens_details.cached_tokens` maps to
102
- `Usage.cacheReadTokens` and `prompt_tokens_details.cache_write_tokens` maps to
103
- `Usage.cacheWriteTokens` when the server reports them.
137
+ Z.AI request body (except `cacheRetention: "none"` disabling thinking).
138
+ - Usage accounting: `prompt_tokens_details.cached_tokens` → `Usage.cacheReadTokens`
139
+ and `prompt_tokens_details.cache_write_tokens` → `Usage.cacheWriteTokens` when
140
+ the server reports them.
104
141
 
105
142
  ## Security and performance notes
106
143
 
107
- - SSE streams and HTTP error bodies use bounded `@arnilo/prism/providers/transport` helpers (`readSseData`, `readBoundedResponseText`).
144
+ - SSE streams and HTTP error bodies use bounded `@arnilo/prism/providers/transport`
145
+ helpers (`readSseData`, `readBoundedResponseText`).
108
146
  - No network calls during import, setup, build, or default tests.
109
147
  - No automatic environment, file, keychain, or shell credential lookup.
110
148
  - API keys are resolved per request from caller-supplied values or resolvers and
111
- redacted from errors.
149
+ redacted from errors (including discovery failures).
112
150
  - Caller-supplied `ProviderRequest.options.headers` can add non-owned headers,
113
151
  but provider-owned headers (`content-type`, `authorization`) are applied last
114
152
  and cannot be overridden by caller headers.
115
- - Live tests stay opt-in behind `PRISM_LIVE_PROVIDER_TESTS=1` plus fake-safe
116
- provider-specific env names; default tests are network-free.
153
+ - Live tests stay opt-in behind `PRISM_LIVE_PROVIDER_TESTS=1` plus `ZAI_API_KEY`;
154
+ default tests are network-free.
117
155
 
118
156
  ## Related APIs
119
157
 
120
158
  - [Provider packages](../provider-packages.md): `defineProviderPackage`,
121
- `ModelConfig`/`compat`, thinking formats.
159
+ caller-gated discovery, per-turn thinking.
160
+ - [Thinking and reasoning](../thinking-and-reasoning.md): portable
161
+ `applyThinkingLevel` → Z.AI `reasoning_effort` / `thinking.type`.
122
162
  - [Credentials and redaction](../credentials-and-redaction.md):
123
163
  `resolveCredentialValue`, `redactSecrets`.
124
- - [OpenAI-compatible provider](openai-compatible.md): underlying Chat Completions
125
- adapter.
164
+ - [Provider caching](../provider-caching.md): implicit GLM context caching.
126
165
  - [Provider conformance](../provider-conformance.md): network-free adapter tests.
166
+
167
+ ## Official evidence
168
+
169
+ - [Deep Thinking](https://docs.z.ai/guides/capabilities/thinking)
170
+ - [Thinking Mode](https://docs.z.ai/guides/capabilities/thinking-mode) (Preserved Thinking / `clear_thinking`)
171
+ - [Tool Streaming](https://docs.z.ai/guides/capabilities/stream-tool)
172
+ - [Context Caching](https://docs.z.ai/guides/capabilities/cache)
173
+ - [Chat Completion](https://docs.z.ai/api-reference/llm/chat-completion)
174
+ - [Migrate to GLM-5.2](https://docs.z.ai/guides/overview/migrate-to-glm-new)
175
+ - [Models overview](https://docs.z.ai/guides/overview/overview)
@@ -6,9 +6,9 @@ Prism is published as one core package, twenty-three first-party capability pack
6
6
 
7
7
  Core package:
8
8
 
9
- - `@arnilo/prism` — the runtime, contracts, registries, streaming events, CLI (including `prism init`), and the `/docs` hub. `files`: `dist` (with `!dist/__tests__` and `!dist/**/*.map` negations), `docs`, `templates`, `CHANGELOG.md`. `bin`: `prism` -> `./dist/cli.js`. `sideEffects`: `["dist/cli.js"]`.
9
+ - `@arnilo/prism` — the runtime, contracts, registries, streaming events, CLI (including `prism init`), and the `/docs` hub. `files`: `dist` (with `!dist/__tests__` and `!dist/**/*.map` negations), `docs`, `templates`, `CHANGELOG.md`. `bin`: `prism` -> `dist/cli.js`. `sideEffects`: `["dist/cli.js"]`.
10
10
 
11
- First-party workspace packages (each has non-optional `@arnilo/prism@0.0.5` peer and `sideEffects: false`; RAG also peers on memory, and server also peers on workflows):
11
+ First-party workspace packages (each has non-optional `@arnilo/prism@0.0.6` peer and `sideEffects: false`; RAG also peers on memory, and server also peers on workflows):
12
12
 
13
13
  - `@arnilo/prism-provider-openai`, `@arnilo/prism-provider-openrouter`, `@arnilo/prism-provider-kimi`, `@arnilo/prism-provider-zai`, `@arnilo/prism-provider-opencode-go`, `@arnilo/prism-provider-neuralwatt` — provider adapters.
14
14
  - `@arnilo/prism-provider-ai-sdk` — optional AI SDK `LanguageModelV4` adapter; included by the provider and all umbrellas.
@@ -36,7 +36,7 @@ Family/profile packages (pure manifests, no code or `dist`; ship `README.md` and
36
36
  - `@arnilo/prism-sdk` — base + workflows + MCP + Node credentials + OpenTelemetry; providers and persistence remain explicit choices.
37
37
  - `@arnilo/prism-all` — every first-party package: code + SDK + providers + persistence + evals + memory/RAG + server + supervisor. Installation alone activates no network/listener, telemetry, database, memory, evaluation, delegation, MCP, shell, or filesystem capability.
38
38
 
39
- Profile footprint snapshot (Node 24/npm 11, lockfile graph, 2026-07-16): `base` reaches 6 first-party packages and one external dependency root (Ajv); `code` reaches 10 and three (Ajv, MCP SDK, diff); `sdk` reaches 11 and three (Ajv, MCP SDK, keyring); `all` reaches all 30 first-party manifests and seven external roots (those plus better-sqlite3, pg, and AI SDK provider types). Native database drivers stay out of base/code/sdk; both appear only in all.
39
+ Profile footprint snapshot (Node 24/npm 11, lockfile graph, 2026-07-19): `base` reaches 6 first-party packages and one external dependency root (Ajv); `code` reaches 10 and three (Ajv, MCP SDK, diff); `sdk` reaches 11 and three (Ajv, MCP SDK, keyring); `all` reaches all 30 first-party manifests and seven external roots (those plus better-sqlite3, pg, and AI SDK provider types). Native database drivers stay out of base/code/sdk; both appear only in all.
40
40
 
41
41
  Each code package's `files` array is `["dist", "!dist/__tests__", "!dist/**/*.map", "README.md", "CHANGELOG.md"]`; `README.md`, `LICENSE`, and `CHANGELOG.md` ship in every code-package tarball, the core tarball also ships the `docs/` directory, and family/profile tarballs ship `README.md` + `CHANGELOG.md` + `package.json`.
42
42
 
@@ -62,9 +62,9 @@ Consumers install the core package for the runtime and add first-party packages
62
62
  | Run the default (network-free) test suite | `npm test` |
63
63
  | Dry-run pack core + every package | `npm run pack:dry-run` |
64
64
  | Local mirror of the release verify gate | `npm run release:dry-run` |
65
- | Validate clean tag/version/ranges and reject registry collisions | `npm run release:check -- --version 0.0.5` |
66
- | Preview deterministic publish order | `npm run release:publish -- --version 0.0.5 --dry-run --allow-dirty --allow-untagged` |
67
- | Resume interrupted tagged publication | `npm run release:publish -- --version 0.0.5 --resume --report release-artifacts/publish-report.json` |
65
+ | Validate clean tag/version/ranges and reject registry collisions | `npm run release:check -- --version 0.0.6` |
66
+ | Preview deterministic publish order | `npm run release:publish -- --version 0.0.6 --dry-run --allow-dirty --allow-untagged` |
67
+ | Resume interrupted tagged publication | `npm run release:publish -- --version 0.0.6 --resume --report release-artifacts/publish-report.json` |
68
68
  | Full SDK readiness gate (typecheck + offline tests + pack) | `npm run sdk:ready` |
69
69
 
70
70
  Public core import specifiers (from the root `exports` map):
@@ -101,7 +101,7 @@ A packed tarball contains only public compiled output and release files:
101
101
  - Code packages ship `README.md`, `LICENSE`, and `CHANGELOG.md`; family/profile packages ship `README.md` and `CHANGELOG.md`.
102
102
  - The core tarball additionally ships the full `docs/` directory (the docs hub) and `templates/init/` used by `prism init`.
103
103
  - `dist/cli.js` and the `bin` link in core.
104
- - **Tarball filenames.** npm strips the `@scope/` prefix, so the core package `@arnilo/prism` produces a tarball named `arnilo-prism-0.0.5.tgz`; first-party packages produce `arnilo-prism-provider-<name>-0.0.5.tgz` / `arnilo-prism-compaction-<name>-0.0.5.tgz` / `arnilo-prism-coding-agent-0.0.5.tgz`; family/profile packages produce `arnilo-prism-{providers,compaction,base,code,sdk,all}-0.0.5.tgz`. The CLI bin name `prism` is unaffected by the package name (`npx prism` still works; npm allows the bin field to differ from the package name).
104
+ - **Tarball filenames.** npm strips the `@scope/` prefix, so the core package `@arnilo/prism` produces a tarball named `arnilo-prism-0.0.6.tgz`; first-party packages produce `arnilo-prism-provider-<name>-0.0.6.tgz` / `arnilo-prism-compaction-<name>-0.0.6.tgz` / `arnilo-prism-coding-agent-0.0.6.tgz`; family/profile packages produce `arnilo-prism-{providers,compaction,base,code,sdk,all}-0.0.6.tgz`. The CLI bin name `prism` is unaffected by the package name (`npx prism` still works; npm allows the bin field to differ from the package name).
105
105
 
106
106
  Excluded from every tarball by `files` negation:
107
107
 
@@ -120,9 +120,9 @@ Excluded from every tarball by `files` negation:
120
120
  "name": "host-app",
121
121
  "type": "module",
122
122
  "dependencies": {
123
- "@arnilo/prism": "0.0.5",
124
- "@arnilo/prism-provider-openai": "0.0.5",
125
- "@arnilo/prism-compaction-observational-memory": "0.0.5"
123
+ "@arnilo/prism": "0.0.6",
124
+ "@arnilo/prism-provider-openai": "0.0.6",
125
+ "@arnilo/prism-compaction-observational-memory": "0.0.6"
126
126
  }
127
127
  }
128
128
  ```
@@ -132,7 +132,7 @@ Installing the provider/compaction packages without `@arnilo/prism` present prod
132
132
  ```text
133
133
  npm error code ERESOLVE
134
134
  npm error Could not resolve dependency:
135
- npm error peer @arnilo/prism@"0.0.5" from @arnilo/prism-provider-openai@0.0.5
135
+ npm error peer @arnilo/prism@"0.0.6" from @arnilo/prism-provider-openai@0.0.6
136
136
  ```
137
137
 
138
138
  ## Implementation example
@@ -165,11 +165,11 @@ For SDK readiness, run the same one-command gate directly. It composes existing
165
165
  npm run sdk:ready
166
166
  ```
167
167
 
168
- Release publication derives all 30 packages from the workspace once, validates exact `0.0.5` manifest/lockfile/internal ranges, then uses deterministic dependency order. `release:check` requires a clean commit tagged `v0.0.5` and rejects any existing registry version. `release:publish --resume` skips only registry versions whose internal dependency fingerprint matches the local manifest; conflicting versions fail closed. Each attempted package is written immediately to the JSON report, so a failed job can rerun safely. `--dry-run` still performs registry availability checks and invokes `npm publish --dry-run` with explicit public access, provenance, and `latest` tag.
168
+ Release publication derives all 30 packages from the workspace once, validates exact `0.0.6` manifest/lockfile/internal ranges, then uses deterministic dependency order. `release:check` requires a clean commit tagged `v0.0.6` and rejects any existing registry version. `release:publish --resume` skips only registry versions whose internal dependency fingerprint matches the local manifest; conflicting versions fail closed. Each attempted package is written immediately to the JSON report, so a failed job can rerun safely. `--dry-run` still performs registry availability checks and invokes `npm publish --dry-run` with explicit public access, provenance, and `latest` tag.
169
169
 
170
170
  ```bash
171
- npm run release:check -- --version 0.0.5
172
- npm run release:publish -- --version 0.0.5 --dry-run --allow-dirty --allow-untagged
171
+ npm run release:check -- --version 0.0.6
172
+ npm run release:publish -- --version 0.0.6 --dry-run --allow-dirty --allow-untagged
173
173
  ```
174
174
 
175
175
  `--allow-dirty` and `--allow-untagged` exist only for local preview; real publication and CI never pass them. npm registry calls occur only in these release preflight/publication commands, never build/test/package discovery.
@@ -180,7 +180,7 @@ Optional live smoke tests stay separate from SDK readiness because they require
180
180
  PRISM_LIVE_PROVIDER_TESTS=1 npm run test --workspaces --if-present
181
181
  ```
182
182
 
183
- ### 0.0.5 publish handoff
183
+ ### 0.0.6 publish handoff
184
184
 
185
185
  **Decision: GO after operator prerequisites below.** Code, tests, package graph, live PostgreSQL, registry availability, packed artifacts, and dependency-ordered publication dry-run passed from the Phase 14 working tree. Clean protected-branch CI, signed commit/tag, npm authentication, OIDC attestation, and actual publication remain operator/workflow prerequisites. No package was published during readiness work.
186
186
 
@@ -190,7 +190,7 @@ The existing GitHub Actions secret `NPM_TOKEN` is used only by the publish step
190
190
 
191
191
  #### Release commit and tag
192
192
 
193
- Merge through the protected release branch, then run these commands from a clean checkout of the protected merge commit. `git push origin v0.0.5` is the workflow dispatch; there is no manual publish command.
193
+ Merge through the protected release branch, then run these commands from a clean checkout of the protected merge commit. `git push origin v0.0.6` is the workflow dispatch; there is no manual publish command.
194
194
 
195
195
  ```bash
196
196
  # Prepare and push the release commit.
@@ -199,22 +199,22 @@ npm ci
199
199
  npm run sdk:ready
200
200
  git add -A
201
201
  git diff --cached --check
202
- git commit -S -m "Release 0.0.5"
202
+ git commit -S -m "Release 0.0.6"
203
203
  git push origin HEAD
204
204
 
205
205
  # Merge/confirm protected branch CI, then check out that exact clean merge commit.
206
206
  test -z "$(git status --porcelain)"
207
207
  npm ci
208
- npm run release:check -- --version 0.0.5 --allow-untagged --report /tmp/prism-0.0.5-preflight.json
208
+ npm run release:check -- --version 0.0.6 --allow-untagged --report /tmp/prism-0.0.6-preflight.json
209
209
 
210
- git tag -s v0.0.5 -m "Prism 0.0.5"
211
- git verify-tag v0.0.5
212
- test "$(git rev-parse HEAD)" = "$(git rev-list -n 1 v0.0.5)"
213
- npm run release:check -- --version 0.0.5 --report /tmp/prism-0.0.5-tagged-preflight.json
214
- git push origin v0.0.5
210
+ git tag -s v0.0.6 -m "Prism 0.0.6"
211
+ git verify-tag v0.0.6
212
+ test "$(git rev-parse HEAD)" = "$(git rev-list -n 1 v0.0.6)"
213
+ npm run release:check -- --version 0.0.6 --report /tmp/prism-0.0.6-tagged-preflight.json
214
+ git push origin v0.0.6
215
215
  ```
216
216
 
217
- The tag workflow's only publication command is `npm run release:publish -- --version "${GITHUB_REF_NAME#v}" --resume --report release-artifacts/publish-report.json`. Latest registry preflight returned `available` for all 30 `0.0.5` versions. Publisher order is stable and dependency-safe:
217
+ The tag workflow's only publication command is `npm run release:publish -- --version "${GITHUB_REF_NAME#v}" --resume --report release-artifacts/publish-report.json`. Latest registry preflight returned `available` for all 30 `0.0.6` versions. Publisher order is stable and dependency-safe:
218
218
 
219
219
  ```text
220
220
  1 @arnilo/prism
@@ -251,7 +251,7 @@ The tag workflow's only publication command is `npm run release:publish -- --ver
251
251
 
252
252
  #### Interruption and resume
253
253
 
254
- Do not create another tag or rerun packages manually. Re-run failed jobs for the same tag in GitHub Actions. The workflow invokes `release:publish --resume`: registry versions with matching names, versions, and internal dependency fingerprints are skipped; any mismatch stops the job. Retain `release-artifacts-v0.0.5` and `publish-report-v0.0.5` for audit.
254
+ Do not create another tag or rerun packages manually. Re-run failed jobs for the same tag in GitHub Actions. The workflow invokes `release:publish --resume`: registry versions with matching names, versions, and internal dependency fingerprints are skipped; any mismatch stops the job. Retain `release-artifacts-v0.0.6` and `publish-report-v0.0.6` for audit.
255
255
 
256
256
  #### Bounded post-publish smoke
257
257
 
@@ -259,9 +259,9 @@ Download the workflow artifact and run `sha256sum -c SHA256SUMS`. Then verify al
259
259
 
260
260
  ```bash
261
261
  while read -r package; do
262
- test "$(npm view "$package@0.0.5" version)" = "0.0.5"
263
- test "$(npm view "$package" dist-tags.latest)" = "0.0.5"
264
- npm view "$package@0.0.5" dist.integrity >/dev/null
262
+ test "$(npm view "$package@0.0.6" version)" = "0.0.6"
263
+ test "$(npm view "$package" dist-tags.latest)" = "0.0.6"
264
+ npm view "$package@0.0.6" dist.integrity >/dev/null
265
265
  done <<'PACKAGES'
266
266
  @arnilo/prism
267
267
  @arnilo/prism-coding-agent
@@ -297,7 +297,7 @@ PACKAGES
297
297
  consumer="$(mktemp -d)"
298
298
  cd "$consumer"
299
299
  npm init -y >/dev/null
300
- npm install --no-audit --no-fund @arnilo/prism-all@0.0.5
300
+ npm install --no-audit --no-fund @arnilo/prism-all@0.0.6
301
301
  node --input-type=module <<'NODE'
302
302
  for (const name of [
303
303
  "@arnilo/prism", "@arnilo/prism-coding-agent", "@arnilo/prism-coding-security",
@@ -319,14 +319,14 @@ This smoke is bounded to registry metadata, imports, CLI startup, checksums, sig
319
319
 
320
320
  #### Rollback limitations
321
321
 
322
- npm publication is not transactional and published versions are immutable. Partial publication is a resume case, not rollback. For a confirmed systemic defect after completion, deprecate every affected `@0.0.5`; restore `latest` to `0.0.3` only for the 13 previously published packages, and remove `latest` from the 11 first-publication packages. Exact `0.0.5` installs remain possible, so publish a fixed version promptly. Do not unpublish except for a security/legal emergency under npm policy.
322
+ npm publication is not transactional and published versions are immutable. Partial publication is a resume case, not rollback. For a confirmed systemic defect after completion, deprecate every affected `@0.0.6`; restore `latest` to `0.0.3` only for the 13 previously published packages, and remove `latest` from the 11 first-publication packages. Exact `0.0.6` installs remain possible, so publish a fixed version promptly. Do not unpublish except for a security/legal emergency under npm policy.
323
323
 
324
324
  ## Extension and configuration notes
325
325
 
326
- - **Required `@arnilo/prism` peer.** Every first-party package declares `peerDependencies: { "@arnilo/prism": "0.0.5" }` with no `peerDependenciesMeta` (non-optional). The range stays pinned to `0.0.5` for the 0.x series and will widen to `^1.0.0` at the 1.x stable release. Inside the workspace each package also declares `"@arnilo/prism": "file:../.."` in `devDependencies` so `npm install` resolves the peer locally; that devDependency is stripped from consumer installs and is not a runtime dependency.
326
+ - **Required `@arnilo/prism` peer.** Every first-party package declares `peerDependencies: { "@arnilo/prism": "0.0.6" }` with no `peerDependenciesMeta` (non-optional). The range stays pinned to `0.0.6` for the 0.x series and will widen to `^1.0.0` at the 1.x stable release. Inside the workspace each package also declares `"@arnilo/prism": "file:../.."` in `devDependencies` so `npm install` resolves the peer locally; that devDependency is stripped from consumer installs and is not a runtime dependency.
327
327
  - **Public access.** All 30 manifests (24 code packages + 6 family/profile packages) declare `"publishConfig": { "access": "public" }`; the publisher also passes `--access public` explicitly because scoped packages otherwise default to restricted on first publish.
328
328
  - **Map retention knob.** Source maps are emitted locally but stripped from tarballs by `!dist/**/*.map`. Removing that `files` negation ships maps in releases (larger tarballs, better consumer stack traces).
329
- - **Release workflow.** `.github/workflows/release.yml` has four jobs. `verify` runs the full SDK readiness gate on Node 24: `npm ci`, then `npm run sdk:ready` (`npm run typecheck`, network-free `npm test`, and `npm run pack:dry-run`). `node20-compat` runs on Node 20: `npm ci`, `npm run build`, then imports every public root `exports` default target from `dist/`. This proves published-package basics under declared `engines.node >=20` without docs examples, which require Node >=22.6 native TypeScript stripping. `postgres-integration` runs the PostgreSQL suite against `pgvector/pgvector:pg16`. `publish` runs only for exact `v*` tags after all three gates, checks clean/tagged state and the complete 0.0.5 graph, then publishes in topological order through `scripts/release.mjs`. The existing `NPM_TOKEN` GitHub secret is exposed only to the publish step; `id-token: write` also enables OIDC where configured. npm receives `--provenance --access public --tag latest`; no credential value is placed in source or output. Before publishing, CI packs all 30 tarballs, generates `SHA256SUMS`, and retains both pack manifests and artifacts for 30 days. Registry state is the resume journal: matching published packages are skipped, mismatches stop publication, and an incremental package-status report is also retained for 30 days. Local `npm run release:dry-run` delegates to `npm run sdk:ready`; local PostgreSQL coverage is `PRISM_TEST_POSTGRES_URL=... npm run test:postgres`.
329
+ - **Release workflow.** `.github/workflows/release.yml` has four jobs. `verify` runs the full SDK readiness gate on Node 24: `npm ci`, then `npm run sdk:ready` (`npm run typecheck`, network-free `npm test`, and `npm run pack:dry-run`). `node20-compat` runs on Node 20: `npm ci`, `npm run build`, then imports every public root `exports` default target from `dist/`. This proves published-package basics under declared `engines.node >=20` without docs examples, which require Node >=22.6 native TypeScript stripping. `postgres-integration` runs the PostgreSQL suite against `pgvector/pgvector:pg16`. `publish` runs only for exact `v*` tags after all three gates, checks clean/tagged state and the complete 0.0.6 graph, then publishes in topological order through `scripts/release.mjs`. The existing `NPM_TOKEN` GitHub secret is exposed only to the publish step; `id-token: write` also enables OIDC where configured. npm receives `--provenance --access public --tag latest`; no credential value is placed in source or output. Before publishing, CI packs all 30 tarballs, generates `SHA256SUMS`, and retains both pack manifests and artifacts for 30 days. Registry state is the resume journal: matching published packages are skipped, mismatches stop publication, and an incremental package-status report is also retained for 30 days. Local `npm run release:dry-run` delegates to `npm run sdk:ready`; local PostgreSQL coverage is `PRISM_TEST_POSTGRES_URL=... npm run test:postgres`.
330
330
  - **Adding a package.** New workspace packages are picked up automatically by `npm run build --workspaces`, `npm test --workspaces`, `npm run pack:dry-run`, the packaging guard (`src/__tests__/packaging.test.ts`), and the install-smoke test (`src/__tests__/install-smoke.test.ts`) via the workspace glob; add the package to both tests' config arrays for explicit per-package assertions.
331
331
 
332
332
  ## Security and performance notes
@@ -349,29 +349,27 @@ npm publication is not transactional and published versions are immutable. Parti
349
349
  - **Install smoke is offline.** The install-smoke test packs core + every package into a temp dir and installs tarballs with `--offline --no-audit --no-fund` into a fresh project. External dependencies are satisfied from the lockfile-backed npm cache prepared by `npm ci`; any attempted uncached registry fetch fails the gate.
350
350
  - **Offline test budget.** The default `npm test` (no `PRISM_LIVE_PROVIDER_TESTS`) is pinned at **< 60s on Node 20** with a measured local baseline of ~45s (build ~18s + network-free tests/workspace tests/packaging smoke ~27s). The full CI `sdk:ready` gate runs on Node 24 because docs tests execute `examples/*.ts` via native TypeScript stripping. `npm run sdk:ready` also runs typecheck and pack dry-run, so it is allowed to exceed the `npm test` budget while remaining network-free. The CI `sdk:ready` step has `timeout-minutes: 5` as a hang backstop; the separate Node 20 compatibility step has `timeout-minutes: 3`. The budget was raised from 30s after the default suite grew to include every first-party package, offline install smoke, packaging guards, docs examples, and workspace tests; optimize before raising it again.
351
351
 
352
- ### 0.0.5 dependency audit decision (2026-07-14)
352
+ ### 0.0.6 dependency audit decision (2026-07-19)
353
353
 
354
- `npm audit --audit-level=high` reports 0 vulnerabilities and `npm ls --all` is clean. Lockfile registry entries all carry integrity hashes and resolved registry URLs; direct/runtime dependency licenses are permissive. `@types/node` was updated within its declared Node 22 range from 22.19.21 to 22.20.1. No runtime dependency changed.
354
+ `npm audit --audit-level=high` reports 0 vulnerabilities and `npm ls --all --depth=0` resolves the exact 30-package `0.0.6` graph. No Phase 1 dependency was added. Native `better-sqlite3` remains the sole install-script dependency and stays in the opt-in SQLite package.
355
355
 
356
- Major updates are deliberately deferred from this feature release: `diff` 8.0.4 → 9 requires coding-tool compatibility review, TypeScript 5.9.3 → 7 requires compiler/output review, and `@types/node` 22 → 26 would exceed the project's Node 20 support target. Revisit each in a dedicated dependency update after 0.0.5; none addresses a current audit finding. Native `better-sqlite3` is the sole dependency with an install hook and remains isolated in the opt-in SQLite package.
356
+ ### 0.0.6 release-candidate verification — 2026-07-19
357
357
 
358
- ### 0.0.5 release-candidate verification — 2026-07-16
359
-
360
- Phase 14 validation ran from the current working tree without creating a release commit/tag or publishing. Clean protected-branch/tag checks remain mandatory in the handoff above.
358
+ Phase 1 validation ran from this working tree without creating a release commit/tag or publishing. Clean protected-branch/tag checks remain mandatory in the handoff above.
361
359
 
362
360
  | Gate | Result |
363
361
  | --- | --- |
364
- | Node 24 full matrix | `npm test` 32.247 s; `npm run sdk:ready` 70.560 s; 1,618 tests (1,593 pass, 25 explicit live skips, 0 fail). The `< 60s` default-test budget and 5-minute SDK hang backstop hold. |
365
- | Node 20 compatibility | Node 20.20.2 imported all 44 built root/package export targets. CI repeats build + root public imports from a clean checkout. |
366
- | PostgreSQL | Fresh `pgvector/pgvector:pg16` container; 29 session/run/feedback/checkpoint/lease/memory/pgvector checks passed with 0 skips/failures. |
367
- | Packed consumer | All 30 exact 0.0.5 tarballs installed together; every root subpath/code package imported. Public packed composition covers streaming, fake AI SDK, eval/feedback, memory/RAG, durable approval, schedules/replay, server/MCP, and supervisor/A2A offline. Generated `prism init` project installs packed core, typechecks, and tests. |
368
- | Artifact contents | All 30 dry-run packs pass with 699 files. Follow-up umbrella snapshot: ~690.6 kB packed / 2.64 MB unpacked total; core ~403.7 kB / 1.46 MB / 221 files; `prism-providers` 1,370 / 3,540 B / 3 files; `prism-all` 1,556 / 3,561 B / 3 files. CI regenerates exact manifests/checksums after the release commit. Denied tests/maps/source/plans/internal artifacts are absent. |
369
- | Registry and order | Live public-registry preflight reports all 30 `@arnilo/*@0.0.5` versions available. Dependency-ordered `release:publish --dry-run` completed 30/30 and retained JSON status/order; no publish occurred. |
370
- | Supply chain | `npm audit --audit-level=high`: 0 vulnerabilities; `npm ls --all`: clean. CycloneDX 1.5 SBOM has 181 components and no prohibited licenses. MIT/ISC/BSD/Apache-family licenses only. `better-sqlite3` is the sole install-script package and remains isolated behind opt-in SQLite. All 30 SHA-256 tarball checksums re-verify; extracted tarball token/private-key scan has 0 hits. |
371
- | Provenance | Dry-run used explicit public/latest/provenance arguments. Signed npm provenance attestation is intentionally generated only by real OIDC publication from the clean signed `v0.0.5` tag workflow. |
372
- | Deferred live smokes | No provider API credentials, OS keychain gate, or external A2A endpoint was configured. Their tests remain explicit opt-in; offline conformance is authoritative for this release candidate. |
373
-
374
- Pack manifests, SBOM, checksums, registry report, and dry-run publish report were generated under `/tmp/prism-p14-release`; CI recreates and retains release artifacts rather than committing generated files.
362
+ | Node 24 full matrix | `npm run sdk:ready` passed inside its five-minute backstop: 1,767 tests (1,742 pass, 25 explicit live skips, 0 fail), full typecheck/build, docs/export/install-smoke tests, and 30 dry-run packs. |
363
+ | Node 20 compatibility | Docker Node 20.20.2 built all workspaces and imported every public root export target. |
364
+ | PostgreSQL | Fresh `pgvector/pgvector:pg16` container: 17 session-store plus 14 memory/pgvector checks passed with 0 skips/failures. |
365
+ | Packed consumer | Offline install-smoke packed all 30 exact `0.0.6` tarballs into a fresh consumer, imported public surfaces, ran packed integration/composition journeys, and ran the generated `prism init` project. |
366
+ | Artifact contents | All 30 dry-run packs passed; core is 230 files, 445.5 kB packed, and 1.6 MB unpacked. Packaging guards reject tests, maps, source, plans, internal artifacts, and real-looking secrets. |
367
+ | Registry and order | Public-registry preflight found all 30 `@arnilo/*@0.0.6` versions available. Dependency-ordered `release:publish --dry-run` completed 30/30 with explicit public/latest/provenance arguments; no publish occurred. Core uses npm's valid `bin` path form `dist/cli.js`. |
368
+ | Supply chain | `npm audit --audit-level=high`: 0 vulnerabilities. `npm ls --all --depth=0`: clean. |
369
+ | Provenance | Signed npm provenance is generated only by real OIDC publication from the clean signed `v0.0.6` tag workflow. |
370
+ | Deferred live smokes | No provider credentials or external A2A endpoint were configured. `PRISM_TEST_KEYCHAIN=1` found no working system-keychain backend (native read returned no value after write); run that explicit round-trip on the release host before publication. |
371
+
372
+ The temporary PostgreSQL container and local dry-run report are not release artifacts. CI recreates and retains package manifests, checksums, and the publication report.
375
373
 
376
374
  ## Release checklist
377
375