@venizia/ignis-atlas 0.1.1-8 → 0.1.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.
@@ -0,0 +1,56 @@
1
+ ---
2
+ title: Error Messages Fill Their Placeholders
3
+ description: "The error response's message fills each %{key} from normalized.args, so a client with no translation for the code shows readable text. normalized.text, Error.message and the log keep the template."
4
+ ---
5
+
6
+ # Changelog - 2026-10-11
7
+
8
+ ## Error messages fill their placeholders
9
+
10
+ <Badge type="tip" text="Enhancement" /> <Badge type="warning" text="Behavior Change" />
11
+
12
+ **In one line.** The response `message` of an intentional error is ready to show.
13
+
14
+ ```typescript
15
+ throw getError({
16
+ message: { text: 'Only %{available} left of %{variantId}.', code: 'stock.unavailable' },
17
+ messageArgs: { available: 2, variantId: 'V1' },
18
+ statusCode: 409,
19
+ });
20
+ ```
21
+
22
+ ```json
23
+ {
24
+ "message": "Only 2 left of V1.",
25
+ "normalized": {
26
+ "text": "Only %{available} left of %{variantId}.",
27
+ "code": "stock.unavailable",
28
+ "args": { "available": 2, "variantId": "V1" }
29
+ }
30
+ }
31
+ ```
32
+
33
+ Before, `message` was the raw template. A client that fell back to `message` for a code it could not translate showed `%{available}` to the user.
34
+
35
+ ## What changed
36
+
37
+ - **`message` is filled.** The error middleware replaces each `%{key}` with `String(args[key])` from `normalized.args`.
38
+ - **`normalized.text` keeps the template.** A client that translates `code` + `args` works unchanged. A `transform` still changes only `normalized.text`.
39
+ - **`Error.message` and the log keep the template.** An arg value stays in the `args` map, where the log redacts secret-shaped keys.
40
+ - **A missing arg stays as written.** Outside production, the middleware logs one warning that names the code and the missing keys. Production stays silent.
41
+ - **Only an intentional error is filled.** A validation, database or unexpected error writes its own text, and that text passes through unchanged.
42
+
43
+ A route error inside a Worker host goes through the same middleware, so it answers the same body.
44
+
45
+ ## Who is affected
46
+
47
+ - **A client that shows `message`.** It now shows readable text. No change needed.
48
+ - **A client or test that compares `message` with the catalog template.** Compare `normalized.text` instead, or expect the filled text.
49
+
50
+ ## Details
51
+
52
+ The fill runs in the response only. Filling `Error.message` too would print each value inline in the log line, outside the redacted `args` map.
53
+
54
+ **Files:** [`packages/kernel/src/base/middlewares/app-error/app-error.middleware.ts`](https://github.com/VENIZIA-AI/ignis/blob/main/packages/kernel/src/base/middlewares/app-error/app-error.middleware.ts), [`packages/kernel/src/base/middlewares/app-error/message.handler.ts`](https://github.com/VENIZIA-AI/ignis/blob/main/packages/kernel/src/base/middlewares/app-error/message.handler.ts)
55
+
56
+ See [Read the error response shape](/extensions/helpers/error/#read-the-error-response-shape) for the full response.
@@ -17,6 +17,7 @@ This section tracks the history of significant changes, refactors, and updates t
17
17
 
18
18
  | Date | Title | Type |
19
19
  |------|-------|------|
20
+ | 2026-10-11 | [Error Messages Fill Their Placeholders](./2026-10-11-error-message-placeholders) | Enhancement, Behavior Change |
20
21
  | 2026-10-09 | [Const Values Stay Literal](./2026-10-09-const-value-literals) | Bug Fix, Breaking Change |
21
22
  | 2026-10-07 | [HttpResponseReader Moves Next to the Server Contract](./2026-10-07-response-reader-in-kernel) | Enhancement |
22
23
  | 2026-10-07 | [A List Answers Extras Only When They Are Asked For](./2026-10-07-list-extras) | Feature |
@@ -13,6 +13,18 @@
13
13
  ],
14
14
  "releases": {
15
15
  "atlas": [
16
+ {
17
+ "version": "0.1.1-9",
18
+ "date": "2026-10-12",
19
+ "sha": "6790dd0c",
20
+ "order": 1607
21
+ },
22
+ {
23
+ "version": "0.1.1-8",
24
+ "date": "2026-10-09",
25
+ "sha": "64d382a1",
26
+ "order": 1603
27
+ },
16
28
  {
17
29
  "version": "0.1.1-7",
18
30
  "date": "2026-10-07",
@@ -797,6 +809,12 @@
797
809
  }
798
810
  ],
799
811
  "connectors": [
812
+ {
813
+ "version": "0.2.1",
814
+ "date": "2026-10-12",
815
+ "sha": "d99fd2d7",
816
+ "order": 1613
817
+ },
800
818
  {
801
819
  "version": "0.2.1-7",
802
820
  "date": "2026-10-07",
@@ -1983,6 +2001,12 @@
1983
2001
  }
1984
2002
  ],
1985
2003
  "core-server": [
2004
+ {
2005
+ "version": "0.2.1",
2006
+ "date": "2026-10-12",
2007
+ "sha": "47b58fe7",
2008
+ "order": 1615
2009
+ },
1986
2010
  {
1987
2011
  "version": "0.2.1-7",
1988
2012
  "date": "2026-10-07",
@@ -2345,6 +2369,12 @@
2345
2369
  }
2346
2370
  ],
2347
2371
  "core-worker": [
2372
+ {
2373
+ "version": "0.2.1",
2374
+ "date": "2026-10-12",
2375
+ "sha": "8005a219",
2376
+ "order": 1614
2377
+ },
2348
2378
  {
2349
2379
  "version": "0.2.1-3",
2350
2380
  "date": "2026-10-07",
@@ -2659,6 +2689,12 @@
2659
2689
  }
2660
2690
  ],
2661
2691
  "dev-configs": [
2692
+ {
2693
+ "version": "0.2.1",
2694
+ "date": "2026-10-12",
2695
+ "sha": "1f0e492a",
2696
+ "order": 1608
2697
+ },
2662
2698
  {
2663
2699
  "version": "0.2.1-0",
2664
2700
  "date": "2026-10-06",
@@ -3067,6 +3103,12 @@
3067
3103
  }
3068
3104
  ],
3069
3105
  "filter": [
3106
+ {
3107
+ "version": "0.2.1",
3108
+ "date": "2026-10-12",
3109
+ "sha": "cb6c1ed8",
3110
+ "order": 1610
3111
+ },
3070
3112
  {
3071
3113
  "version": "0.2.1-1",
3072
3114
  "date": "2026-10-06",
@@ -3255,6 +3297,12 @@
3255
3297
  }
3256
3298
  ],
3257
3299
  "helpers": [
3300
+ {
3301
+ "version": "0.2.1",
3302
+ "date": "2026-10-12",
3303
+ "sha": "e7a82e29",
3304
+ "order": 1611
3305
+ },
3258
3306
  {
3259
3307
  "version": "0.2.1-3",
3260
3308
  "date": "2026-10-09",
@@ -3995,6 +4043,12 @@
3995
4043
  }
3996
4044
  ],
3997
4045
  "inversion": [
4046
+ {
4047
+ "version": "0.2.1",
4048
+ "date": "2026-10-12",
4049
+ "sha": "7b41cd51",
4050
+ "order": 1609
4051
+ },
3998
4052
  {
3999
4053
  "version": "0.2.1-1",
4000
4054
  "date": "2026-10-09",
@@ -4339,6 +4393,18 @@
4339
4393
  }
4340
4394
  ],
4341
4395
  "kernel": [
4396
+ {
4397
+ "version": "0.2.1",
4398
+ "date": "2026-10-12",
4399
+ "sha": "aab3bfe5",
4400
+ "order": 1612
4401
+ },
4402
+ {
4403
+ "version": "0.2.1-6",
4404
+ "date": "2026-10-12",
4405
+ "sha": "c004a935",
4406
+ "order": 1605
4407
+ },
4342
4408
  {
4343
4409
  "version": "0.2.1-5",
4344
4410
  "date": "2026-10-07",
@@ -4672,6 +4738,17 @@
4672
4738
  ]
4673
4739
  },
4674
4740
  "changelogs": [
4741
+ {
4742
+ "id": "changelog:2026-10-11-error-message-placeholders",
4743
+ "file": "2026-10-11-error-message-placeholders.md",
4744
+ "date": "2026-10-11",
4745
+ "title": "Error Messages Fill Their Placeholders",
4746
+ "packages": [
4747
+ "kernel"
4748
+ ],
4749
+ "kind": "Enhancement",
4750
+ "order": 1604
4751
+ },
4675
4752
  {
4676
4753
  "id": "changelog:2026-10-09-const-value-literals",
4677
4754
  "file": "2026-10-09-const-value-literals.md",
@@ -629,7 +629,7 @@
629
629
  "specifier": "@venizia/ignis",
630
630
  "kind": "class",
631
631
  "file": "packages/kernel/src/base/middlewares/app-error/app-error.middleware.ts",
632
- "line": 87,
632
+ "line": 88,
633
633
  "signature": "class BaseAppErrorMiddleware extends BaseHelper implements IProvider<ErrorHandler>"
634
634
  },
635
635
  {
@@ -6472,7 +6472,7 @@
6472
6472
  "specifier": "@venizia/ignis",
6473
6473
  "kind": "type",
6474
6474
  "file": "packages/kernel/src/base/middlewares/app-error/app-error.middleware.ts",
6475
- "line": 25,
6475
+ "line": 26,
6476
6476
  "signature": "type TErrorLogFormatter = (opts: { error: unknown; messageCode?: string; extra?: Record<string, unknown>; includeStack?: boolean; maxStackFrames?: number; }) => string"
6477
6477
  },
6478
6478
  {
@@ -30413,7 +30413,7 @@
30413
30413
  "specifier": "@venizia/ignis-kernel",
30414
30414
  "kind": "class",
30415
30415
  "file": "packages/kernel/src/base/middlewares/app-error/app-error.middleware.ts",
30416
- "line": 87,
30416
+ "line": 88,
30417
30417
  "signature": "class BaseAppErrorMiddleware extends BaseHelper implements IProvider<ErrorHandler>"
30418
30418
  },
30419
30419
  {
@@ -32763,7 +32763,7 @@
32763
32763
  "specifier": "@venizia/ignis-kernel",
32764
32764
  "kind": "type",
32765
32765
  "file": "packages/kernel/src/base/middlewares/app-error/app-error.middleware.ts",
32766
- "line": 25,
32766
+ "line": 26,
32767
32767
  "signature": "type TErrorLogFormatter = (opts: { error: unknown; messageCode?: string; extra?: Record<string, unknown>; includeStack?: boolean; maxStackFrames?: number; }) => string"
32768
32768
  },
32769
32769
  {
@@ -349,6 +349,8 @@ interface ErrorResponse {
349
349
 
350
350
  There's no top-level `messageCode` - read `normalized.code`. `extra` never mirrors `messageArgs`; the resolved interpolation values live at `normalized.args`.
351
351
 
352
+ An intentional error's `message` has each `%{key}` filled from `normalized.args`, so a client can show it as is. `normalized.text` keeps the template for a client that translates `code` + `args`.
353
+
352
354
  **400 Bad Request:**
353
355
 
354
356
  ```json
@@ -266,7 +266,7 @@ const NOT_FOUND = MessageCode.build({ parts: ['core', 'user', 'not_found'] });
266
266
  | `ZodError` (validation) | 422 | the first issue's `params.code`, else its raw Zod code | that issue's message; per-field list in `details.cause` | never |
267
267
  | DB client error (SQLSTATE class 22/23/44) | 400 | `core.system_error` | a fixed, safe summary - never the driver's text | never |
268
268
  | Transient DB conflict (40001/40P01) | 409 | `database.conflict` | a fixed retry message | never |
269
- | `getError(...)` - intentional | its own | its own | its own | when the throw site attached `extra` or unknown keys |
269
+ | `getError(...)` - intentional | its own | its own | its own, with each `%{key}` filled from `normalized.args` | when the throw site attached `extra` or unknown keys |
270
270
  | Anything else | 500 | `core.system_error` | `Internal Server Error` in production; the raw message in development | never |
271
271
 
272
272
  Only the intentional branch reports what the throw site wrote. The other four **replace** the message - a driver error can carry SQL, schema, and constraint names. `normalized` is built from that replacement, so it can never leak what `message` just scrubbed.
@@ -277,7 +277,7 @@ The handler is fail-closed on environment. It exposes `stack` and `cause` in `de
277
277
 
278
278
  ```json
279
279
  {
280
- "message": "Only %{available} left of %{variantId}.",
280
+ "message": "Only 2 left of V1.",
281
281
  "statusCode": 409,
282
282
  "normalized": {
283
283
  "text": "Only %{available} left of %{variantId}.",
@@ -300,7 +300,9 @@ The handler is fail-closed on environment. It exposes `stack` and `cause` in `de
300
300
  > Note the two `details`. The inner one is context the throw site attached - it went through `extra`. The outer one is the middleware's own request info. They're unrelated despite sharing a name.
301
301
 
302
302
  > [!NOTE]
303
- > `message` and `normalized.text` are the same string, unless a `transform` deliberately makes them differ. `message` stays the raw text the throw site wrote. `normalized.text` is what a client shows. Most errors never set `transform`, so most of the time the two match.
303
+ > `message` is ready to show: the middleware fills each `%{key}` with `String(args[key])` from `normalized.args`. `normalized.text` keeps the template, so a client that translates `code` + `args` formats it itself. A `transform` changes only `normalized.text`.
304
+ >
305
+ > A key with no arg stays as written. Outside production, the middleware logs one warning naming the code and the missing keys. `Error.message` and the log line keep the template, so an arg value never leaves the redacted `args` map.
304
306
 
305
307
  ### Consume the error response from a browser client
306
308
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@venizia/ignis-atlas",
3
- "version": "0.1.1-8",
3
+ "version": "0.1.1",
4
4
  "description": "MCP server for IGNIS: search and read the wiki, changelogs and knowledge bundle by section, with citations. Bun-only, zero-dependency transport.",
5
5
  "homepage": "https://ignis.venizia.ai",
6
6
  "repository": {
@@ -60,12 +60,12 @@
60
60
  },
61
61
  "dependencies": {
62
62
  "@hono/zod-openapi": "^1.6.3",
63
- "@venizia/ignis-helpers": "^0.2.1-3",
63
+ "@venizia/ignis-helpers": "^0.2.1",
64
64
  "zod": "^4.5.4"
65
65
  },
66
66
  "devDependencies": {
67
67
  "@types/bun": "^1.4.1",
68
- "@venizia/dev-configs": "^0.2.1-0",
68
+ "@venizia/dev-configs": "^0.2.1",
69
69
  "eslint": "^10.10.0",
70
70
  "prettier": "^3.9.6",
71
71
  "tsc-alias": "^1.9.4",