@venizia/ignis-atlas 0.1.2-0 → 0.1.2-2

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.
@@ -51,6 +51,6 @@ A route error inside a Worker host goes through the same middleware, so it answe
51
51
 
52
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
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)
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/inversion/src/modules/error/message-template.ts`](https://github.com/VENIZIA-AI/ignis/blob/main/packages/inversion/src/modules/error/message-template.ts)
55
55
 
56
56
  See [Read the error response shape](/extensions/helpers/error/#read-the-error-response-shape) for the full response.
@@ -0,0 +1,40 @@
1
+ ---
2
+ title: An Error Hands Out Its Filled Text
3
+ description: "ApplicationError.toFilledText() fills the args into the message template, for a reader that only knows .message - a queue's failure reason, a third-party log. message itself stays the template."
4
+ ---
5
+
6
+ # Changelog - 2026-10-14
7
+
8
+ ## An error hands out its filled text
9
+
10
+ <Badge type="tip" text="Enhancement" />
11
+
12
+ **In one line.** `error.toFilledText()` gives the sentence a person reads; `error.message` stays the template.
13
+
14
+ ```typescript
15
+ const error = getError({
16
+ message: { text: 'Only %{available} left of %{sku}.', code: 'stock.unavailable' },
17
+ messageArgs: { available: 2, sku: 'TRA-01' },
18
+ statusCode: 409,
19
+ });
20
+
21
+ error.toFilledText(); // 'Only 2 left of TRA-01.'
22
+ error.message; // 'Only %{available} left of %{sku}.'
23
+ ```
24
+
25
+ ## What changed
26
+
27
+ The error response already filled its `message` (2026-10-11). A reader outside the response did not get that: a BullMQ job stores `job.failedReason = error.message`, so its dashboard showed `%{available}`.
28
+
29
+ - **`toFilledText()`** on `ApplicationError` fills each `%{key}` from `normalized.args`. A key with no arg stays as written.
30
+ - **`MessageTemplate.render({ text, args })`** is the fill itself, exported from `@venizia/ignis-inversion` and `@venizia/ignis-helpers`. It also returns the keys it found no arg for. The error middleware uses it, so the response and `toFilledText()` fill the same way.
31
+ - **`message` does not change.** A filled `message` would print every arg value in each log line and error tracker, outside the `args` map the log redacts by key. Fill where you choose to store the text.
32
+
33
+ ## Who is affected
34
+
35
+ - **A queue, tracker or log that stores `error.message`.** Call `toFilledText()` where you hand the error over - see [Store the filled text](/extensions/helpers/error/#store-the-filled-text-where-a-plain-reader-shows-it).
36
+ - **A client that casts a response error to `ApplicationError`.** The cast object has no `toFilledText()`; calling it throws at run time. Use `fromError({ error }).toFilledText()`, or the response `message`, which the server already fills.
37
+ - **An object literal typed `ApplicationError`** - a test fixture, a mock - no longer compiles, because it lacks the method. Build it with `getError(...)`.
38
+ - **Everyone else.** No change.
39
+
40
+ **Files:** [`packages/inversion/src/modules/error/message-template.ts`](https://github.com/VENIZIA-AI/ignis/blob/main/packages/inversion/src/modules/error/message-template.ts), [`packages/inversion/src/modules/error/app-error.ts`](https://github.com/VENIZIA-AI/ignis/blob/main/packages/inversion/src/modules/error/app-error.ts), [`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)
@@ -0,0 +1,37 @@
1
+ ---
2
+ title: isApplicationError Checks the Whole Shape
3
+ description: "isApplicationError() now also requires normalized.text, so a plain Error that only carries a statusCode - an HTTP client's, an engine's - is no longer taken for an ApplicationError."
4
+ ---
5
+
6
+ # Changelog - 2026-10-15
7
+
8
+ ## isApplicationError checks the whole shape
9
+
10
+ <Badge type="danger" text="Bug Fix" /> <Badge type="warning" text="Behavior Change" />
11
+
12
+ **In one line.** A plain `Error` with a `statusCode` is no longer an `ApplicationError`.
13
+
14
+ ```typescript
15
+ const httpError = Object.assign(new Error('Request failed'), { statusCode: 502 });
16
+
17
+ isApplicationError(httpError); // false - it was true
18
+ isApplicationError(getError({ message: 'x', statusCode: 400 })); // true, as before
19
+ ```
20
+
21
+ ## What changed
22
+
23
+ `isApplicationError()` checked only `instanceof Error` and a numeric `statusCode`, yet narrowed the type to `ApplicationError`. Code after the guard then read `normalized` or called `toFilledText()` on an error that had neither, and crashed.
24
+
25
+ The guard now also requires `normalized` to be an object with a string `text`. It still tests shape, not class identity, so an `ApplicationError` from the other build copy (CJS against ESM) still matches.
26
+
27
+ Inside IGNIS this also fixes three paths that trusted the guard:
28
+ - A worker encoded such an error as an `ApplicationError` envelope with no `normalized`.
29
+ - The search connectors and the mail service rethrew it unwrapped, instead of sanitizing it as a 503 or 500.
30
+
31
+ ## Who is affected
32
+
33
+ - **Code that relied on a `statusCode`-only error passing the guard.** Build the error with `getError`, or check `statusCode` yourself.
34
+ - **An `ApplicationError` from a copy older than 0.2.2-0.** It still matches, but has no `toFilledText()`.
35
+ - **Everyone else.** No change.
36
+
37
+ **Files:** [`packages/inversion/src/modules/error/app-error.ts`](https://github.com/VENIZIA-AI/ignis/blob/main/packages/inversion/src/modules/error/app-error.ts)
@@ -17,6 +17,8 @@ This section tracks the history of significant changes, refactors, and updates t
17
17
 
18
18
  | Date | Title | Type |
19
19
  |------|-------|------|
20
+ | 2026-10-15 | [isApplicationError Checks the Whole Shape](./2026-10-15-is-application-error-shape) | Bug Fix, Behavior Change |
21
+ | 2026-10-14 | [An Error Hands Out Its Filled Text](./2026-10-14-error-filled-text) | Enhancement |
20
22
  | 2026-10-14 | [TemporalHelper Runs in Every Browser and Speaks a Locale](./2026-10-14-temporal-browser-and-locale) | Feature |
21
23
  | 2026-10-11 | [Error Messages Fill Their Placeholders](./2026-10-11-error-message-placeholders) | Enhancement, Behavior Change |
22
24
  | 2026-10-09 | [Const Values Stay Literal](./2026-10-09-const-value-literals) | Bug Fix, Breaking Change |
@@ -13,6 +13,18 @@
13
13
  ],
14
14
  "releases": {
15
15
  "atlas": [
16
+ {
17
+ "version": "0.1.2-1",
18
+ "date": "2026-10-14",
19
+ "sha": "f1b874e2",
20
+ "order": 1635
21
+ },
22
+ {
23
+ "version": "0.1.2-0",
24
+ "date": "2026-10-14",
25
+ "sha": "7a13b114",
26
+ "order": 1625
27
+ },
16
28
  {
17
29
  "version": "0.1.1",
18
30
  "date": "2026-10-12",
@@ -815,6 +827,18 @@
815
827
  }
816
828
  ],
817
829
  "connectors": [
830
+ {
831
+ "version": "0.2.2-2",
832
+ "date": "2026-10-15",
833
+ "sha": "603e7e36",
834
+ "order": 1642
835
+ },
836
+ {
837
+ "version": "0.2.2-1",
838
+ "date": "2026-10-14",
839
+ "sha": "a0960da2",
840
+ "order": 1631
841
+ },
818
842
  {
819
843
  "version": "0.2.2-0",
820
844
  "date": "2026-10-14",
@@ -2013,6 +2037,18 @@
2013
2037
  }
2014
2038
  ],
2015
2039
  "core-server": [
2040
+ {
2041
+ "version": "0.2.2-2",
2042
+ "date": "2026-10-15",
2043
+ "sha": "0891916f",
2044
+ "order": 1644
2045
+ },
2046
+ {
2047
+ "version": "0.2.2-1",
2048
+ "date": "2026-10-14",
2049
+ "sha": "88b2fe0d",
2050
+ "order": 1633
2051
+ },
2016
2052
  {
2017
2053
  "version": "0.2.2-0",
2018
2054
  "date": "2026-10-14",
@@ -2387,6 +2423,18 @@
2387
2423
  }
2388
2424
  ],
2389
2425
  "core-worker": [
2426
+ {
2427
+ "version": "0.2.2-2",
2428
+ "date": "2026-10-15",
2429
+ "sha": "ea156f9f",
2430
+ "order": 1643
2431
+ },
2432
+ {
2433
+ "version": "0.2.2-1",
2434
+ "date": "2026-10-14",
2435
+ "sha": "5c81ac61",
2436
+ "order": 1632
2437
+ },
2390
2438
  {
2391
2439
  "version": "0.2.2-0",
2392
2440
  "date": "2026-10-14",
@@ -3127,6 +3175,18 @@
3127
3175
  }
3128
3176
  ],
3129
3177
  "filter": [
3178
+ {
3179
+ "version": "0.2.2-1",
3180
+ "date": "2026-10-15",
3181
+ "sha": "fe28ce8d",
3182
+ "order": 1639
3183
+ },
3184
+ {
3185
+ "version": "0.2.2-0",
3186
+ "date": "2026-10-14",
3187
+ "sha": "10de4309",
3188
+ "order": 1628
3189
+ },
3130
3190
  {
3131
3191
  "version": "0.2.1",
3132
3192
  "date": "2026-10-12",
@@ -3321,6 +3381,18 @@
3321
3381
  }
3322
3382
  ],
3323
3383
  "helpers": [
3384
+ {
3385
+ "version": "0.2.2-2",
3386
+ "date": "2026-10-15",
3387
+ "sha": "d3c49a54",
3388
+ "order": 1640
3389
+ },
3390
+ {
3391
+ "version": "0.2.2-1",
3392
+ "date": "2026-10-14",
3393
+ "sha": "7d9c118b",
3394
+ "order": 1629
3395
+ },
3324
3396
  {
3325
3397
  "version": "0.2.2-0",
3326
3398
  "date": "2026-10-14",
@@ -4073,6 +4145,18 @@
4073
4145
  }
4074
4146
  ],
4075
4147
  "inversion": [
4148
+ {
4149
+ "version": "0.2.2-1",
4150
+ "date": "2026-10-15",
4151
+ "sha": "20176300",
4152
+ "order": 1638
4153
+ },
4154
+ {
4155
+ "version": "0.2.2-0",
4156
+ "date": "2026-10-14",
4157
+ "sha": "b079323a",
4158
+ "order": 1627
4159
+ },
4076
4160
  {
4077
4161
  "version": "0.2.1",
4078
4162
  "date": "2026-10-12",
@@ -4423,6 +4507,18 @@
4423
4507
  }
4424
4508
  ],
4425
4509
  "kernel": [
4510
+ {
4511
+ "version": "0.2.2-2",
4512
+ "date": "2026-10-15",
4513
+ "sha": "30be1585",
4514
+ "order": 1641
4515
+ },
4516
+ {
4517
+ "version": "0.2.2-1",
4518
+ "date": "2026-10-14",
4519
+ "sha": "e9a0a0a6",
4520
+ "order": 1630
4521
+ },
4426
4522
  {
4427
4523
  "version": "0.2.2-0",
4428
4524
  "date": "2026-10-14",
@@ -4774,6 +4870,17 @@
4774
4870
  ]
4775
4871
  },
4776
4872
  "changelogs": [
4873
+ {
4874
+ "id": "changelog:2026-10-15-is-application-error-shape",
4875
+ "file": "2026-10-15-is-application-error-shape.md",
4876
+ "date": "2026-10-15",
4877
+ "title": "isApplicationError Checks the Whole Shape",
4878
+ "packages": [
4879
+ "inversion"
4880
+ ],
4881
+ "kind": "Bug Fix",
4882
+ "order": 1637
4883
+ },
4777
4884
  {
4778
4885
  "id": "changelog:2026-10-14-temporal-browser-and-locale",
4779
4886
  "file": "2026-10-14-temporal-browser-and-locale.md",
@@ -4785,12 +4892,25 @@
4785
4892
  "kind": "Feature",
4786
4893
  "order": 1618
4787
4894
  },
4895
+ {
4896
+ "id": "changelog:2026-10-14-error-filled-text",
4897
+ "file": "2026-10-14-error-filled-text.md",
4898
+ "date": "2026-10-14",
4899
+ "title": "An Error Hands Out Its Filled Text",
4900
+ "packages": [
4901
+ "helpers",
4902
+ "inversion"
4903
+ ],
4904
+ "kind": "Enhancement",
4905
+ "order": 1626
4906
+ },
4788
4907
  {
4789
4908
  "id": "changelog:2026-10-11-error-message-placeholders",
4790
4909
  "file": "2026-10-11-error-message-placeholders.md",
4791
4910
  "date": "2026-10-11",
4792
4911
  "title": "Error Messages Fill Their Placeholders",
4793
4912
  "packages": [
4913
+ "inversion",
4794
4914
  "kernel"
4795
4915
  ],
4796
4916
  "kind": "Enhancement",
@@ -329,7 +329,7 @@
329
329
  "specifier": "@venizia/ignis",
330
330
  "kind": "class",
331
331
  "file": "packages/inversion/src/modules/error/app-error.ts",
332
- "line": 20,
332
+ "line": 21,
333
333
  "signature": "class ApplicationError extends Error"
334
334
  },
335
335
  {
@@ -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": 88,
632
+ "line": 93,
633
633
  "signature": "class BaseAppErrorMiddleware extends BaseHelper implements IProvider<ErrorHandler>"
634
634
  },
635
635
  {
@@ -4634,6 +4634,16 @@
4634
4634
  "line": 6,
4635
4635
  "signature": "class MessageCode"
4636
4636
  },
4637
+ {
4638
+ "name": "MessageTemplate",
4639
+ "package": "@venizia/ignis",
4640
+ "subpath": ".",
4641
+ "specifier": "@venizia/ignis",
4642
+ "kind": "class",
4643
+ "file": "packages/inversion/src/modules/error/message-template.ts",
4644
+ "line": 9,
4645
+ "signature": "class MessageTemplate"
4646
+ },
4637
4647
  {
4638
4648
  "name": "MetadataKeys",
4639
4649
  "package": "@venizia/ignis",
@@ -6502,7 +6512,7 @@
6502
6512
  "specifier": "@venizia/ignis",
6503
6513
  "kind": "type",
6504
6514
  "file": "packages/kernel/src/base/middlewares/app-error/app-error.middleware.ts",
6505
- "line": 26,
6515
+ "line": 31,
6506
6516
  "signature": "type TErrorLogFormatter = (opts: { error: unknown; messageCode?: string; extra?: Record<string, unknown>; includeStack?: boolean; maxStackFrames?: number; }) => string"
6507
6517
  },
6508
6518
  {
@@ -9182,7 +9192,7 @@
9182
9192
  "specifier": "@venizia/ignis",
9183
9193
  "kind": "const",
9184
9194
  "file": "packages/inversion/src/modules/error/app-error.ts",
9185
- "line": 91,
9195
+ "line": 101,
9186
9196
  "signature": "fromError: (opts: { error: TResponsedError; }) => ApplicationError"
9187
9197
  },
9188
9198
  {
@@ -9282,7 +9292,7 @@
9282
9292
  "specifier": "@venizia/ignis",
9283
9293
  "kind": "const",
9284
9294
  "file": "packages/inversion/src/modules/error/app-error.ts",
9285
- "line": 89,
9295
+ "line": 99,
9286
9296
  "signature": "getError: (opts: TError) => ApplicationError"
9287
9297
  },
9288
9298
  {
@@ -9412,7 +9422,7 @@
9412
9422
  "specifier": "@venizia/ignis",
9413
9423
  "kind": "const",
9414
9424
  "file": "packages/inversion/src/modules/error/app-error.ts",
9415
- "line": 94,
9425
+ "line": 111,
9416
9426
  "signature": "isApplicationError: (error: unknown) => error is ApplicationError"
9417
9427
  },
9418
9428
  {
@@ -22120,7 +22130,7 @@
22120
22130
  "specifier": "@venizia/ignis-helpers",
22121
22131
  "kind": "class",
22122
22132
  "file": "packages/inversion/src/modules/error/app-error.ts",
22123
- "line": 20,
22133
+ "line": 21,
22124
22134
  "signature": "class ApplicationError extends Error"
22125
22135
  },
22126
22136
  {
@@ -23995,6 +24005,16 @@
23995
24005
  "line": 6,
23996
24006
  "signature": "class MessageCode"
23997
24007
  },
24008
+ {
24009
+ "name": "MessageTemplate",
24010
+ "package": "@venizia/ignis-helpers",
24011
+ "subpath": ".",
24012
+ "specifier": "@venizia/ignis-helpers",
24013
+ "kind": "class",
24014
+ "file": "packages/inversion/src/modules/error/message-template.ts",
24015
+ "line": 9,
24016
+ "signature": "class MessageTemplate"
24017
+ },
23998
24018
  {
23999
24019
  "name": "MimeTypes",
24000
24020
  "package": "@venizia/ignis-helpers",
@@ -25743,7 +25763,7 @@
25743
25763
  "specifier": "@venizia/ignis-helpers",
25744
25764
  "kind": "const",
25745
25765
  "file": "packages/inversion/src/modules/error/app-error.ts",
25746
- "line": 91,
25766
+ "line": 101,
25747
25767
  "signature": "fromError: (opts: { error: TResponsedError; }) => ApplicationError"
25748
25768
  },
25749
25769
  {
@@ -25763,7 +25783,7 @@
25763
25783
  "specifier": "@venizia/ignis-helpers",
25764
25784
  "kind": "const",
25765
25785
  "file": "packages/inversion/src/modules/error/app-error.ts",
25766
- "line": 89,
25786
+ "line": 99,
25767
25787
  "signature": "getError: (opts: TError) => ApplicationError"
25768
25788
  },
25769
25789
  {
@@ -25833,7 +25853,7 @@
25833
25853
  "specifier": "@venizia/ignis-helpers",
25834
25854
  "kind": "const",
25835
25855
  "file": "packages/inversion/src/modules/error/app-error.ts",
25836
- "line": 94,
25856
+ "line": 111,
25837
25857
  "signature": "isApplicationError: (error: unknown) => error is ApplicationError"
25838
25858
  },
25839
25859
  {
@@ -26933,7 +26953,7 @@
26933
26953
  "specifier": "@venizia/ignis-helpers/core",
26934
26954
  "kind": "class",
26935
26955
  "file": "packages/inversion/src/modules/error/app-error.ts",
26936
- "line": 20,
26956
+ "line": 21,
26937
26957
  "signature": "class ApplicationError extends Error"
26938
26958
  },
26939
26959
  {
@@ -27556,6 +27576,16 @@
27556
27576
  "line": 6,
27557
27577
  "signature": "class MessageCode"
27558
27578
  },
27579
+ {
27580
+ "name": "MessageTemplate",
27581
+ "package": "@venizia/ignis-helpers",
27582
+ "subpath": "./core",
27583
+ "specifier": "@venizia/ignis-helpers/core",
27584
+ "kind": "class",
27585
+ "file": "packages/inversion/src/modules/error/message-template.ts",
27586
+ "line": 9,
27587
+ "signature": "class MessageTemplate"
27588
+ },
27559
27589
  {
27560
27590
  "name": "NativeTemporalAdapter",
27561
27591
  "package": "@venizia/ignis-helpers",
@@ -28153,7 +28183,7 @@
28153
28183
  "specifier": "@venizia/ignis-helpers/core",
28154
28184
  "kind": "const",
28155
28185
  "file": "packages/inversion/src/modules/error/app-error.ts",
28156
- "line": 91,
28186
+ "line": 101,
28157
28187
  "signature": "fromError: (opts: { error: TResponsedError; }) => ApplicationError"
28158
28188
  },
28159
28189
  {
@@ -28163,7 +28193,7 @@
28163
28193
  "specifier": "@venizia/ignis-helpers/core",
28164
28194
  "kind": "const",
28165
28195
  "file": "packages/inversion/src/modules/error/app-error.ts",
28166
- "line": 89,
28196
+ "line": 99,
28167
28197
  "signature": "getError: (opts: TError) => ApplicationError"
28168
28198
  },
28169
28199
  {
@@ -28183,7 +28213,7 @@
28183
28213
  "specifier": "@venizia/ignis-helpers/core",
28184
28214
  "kind": "const",
28185
28215
  "file": "packages/inversion/src/modules/error/app-error.ts",
28186
- "line": 94,
28216
+ "line": 111,
28187
28217
  "signature": "isApplicationError: (error: unknown) => error is ApplicationError"
28188
28218
  },
28189
28219
  {
@@ -29603,7 +29633,7 @@
29603
29633
  "specifier": "@venizia/ignis-inversion",
29604
29634
  "kind": "class",
29605
29635
  "file": "packages/inversion/src/modules/error/app-error.ts",
29606
- "line": 20,
29636
+ "line": 21,
29607
29637
  "signature": "class ApplicationError extends Error"
29608
29638
  },
29609
29639
  {
@@ -29786,6 +29816,16 @@
29786
29816
  "line": 6,
29787
29817
  "signature": "class MessageCode"
29788
29818
  },
29819
+ {
29820
+ "name": "MessageTemplate",
29821
+ "package": "@venizia/ignis-inversion",
29822
+ "subpath": ".",
29823
+ "specifier": "@venizia/ignis-inversion",
29824
+ "kind": "class",
29825
+ "file": "packages/inversion/src/modules/error/message-template.ts",
29826
+ "line": 9,
29827
+ "signature": "class MessageTemplate"
29828
+ },
29789
29829
  {
29790
29830
  "name": "MetadataKeys",
29791
29831
  "package": "@venizia/ignis-inversion",
@@ -29823,7 +29863,7 @@
29823
29863
  "specifier": "@venizia/ignis-inversion",
29824
29864
  "kind": "type",
29825
29865
  "file": "packages/inversion/src/modules/error/app-error.ts",
29826
- "line": 98,
29866
+ "line": 126,
29827
29867
  "signature": "type TApplicationError = ApplicationError"
29828
29868
  },
29829
29869
  {
@@ -30153,7 +30193,7 @@
30153
30193
  "specifier": "@venizia/ignis-inversion",
30154
30194
  "kind": "const",
30155
30195
  "file": "packages/inversion/src/modules/error/app-error.ts",
30156
- "line": 91,
30196
+ "line": 101,
30157
30197
  "signature": "fromError: (opts: { error: TResponsedError; }) => ApplicationError"
30158
30198
  },
30159
30199
  {
@@ -30163,7 +30203,7 @@
30163
30203
  "specifier": "@venizia/ignis-inversion",
30164
30204
  "kind": "const",
30165
30205
  "file": "packages/inversion/src/modules/error/app-error.ts",
30166
- "line": 89,
30206
+ "line": 99,
30167
30207
  "signature": "getError: (opts: TError) => ApplicationError"
30168
30208
  },
30169
30209
  {
@@ -30183,7 +30223,7 @@
30183
30223
  "specifier": "@venizia/ignis-inversion",
30184
30224
  "kind": "const",
30185
30225
  "file": "packages/inversion/src/modules/error/app-error.ts",
30186
- "line": 94,
30226
+ "line": 111,
30187
30227
  "signature": "isApplicationError: (error: unknown) => error is ApplicationError"
30188
30228
  },
30189
30229
  {
@@ -30613,7 +30653,7 @@
30613
30653
  "specifier": "@venizia/ignis-kernel",
30614
30654
  "kind": "class",
30615
30655
  "file": "packages/kernel/src/base/middlewares/app-error/app-error.middleware.ts",
30616
- "line": 88,
30656
+ "line": 93,
30617
30657
  "signature": "class BaseAppErrorMiddleware extends BaseHelper implements IProvider<ErrorHandler>"
30618
30658
  },
30619
30659
  {
@@ -32963,7 +33003,7 @@
32963
33003
  "specifier": "@venizia/ignis-kernel",
32964
33004
  "kind": "type",
32965
33005
  "file": "packages/kernel/src/base/middlewares/app-error/app-error.middleware.ts",
32966
- "line": 26,
33006
+ "line": 31,
32967
33007
  "signature": "type TErrorLogFormatter = (opts: { error: unknown; messageCode?: string; extra?: Record<string, unknown>; includeStack?: boolean; maxStackFrames?: number; }) => string"
32968
33008
  },
32969
33009
  {
@@ -67,7 +67,7 @@ The framework's `AppErrorMiddleware` catches `ApplicationError` instances and fo
67
67
  - **`error` is refused on the free-form branch (`error?: never`).** This makes `getError({ message, error: caughtError })` fail to compile, so the mistake is caught before runtime - use `cause` instead.
68
68
 
69
69
  > [!IMPORTANT]
70
- > **Use `isApplicationError()`, never `instanceof ApplicationError`.** There is one `ApplicationError` class, defined in `@venizia/ignis-inversion`. `helpers` re-exports it, so a browser app can raise and read the same errors the server does. But `instanceof` still fails across a package boundary: inversion ships dual CJS+ESM builds, so one source class has two runtime constructors. `isApplicationError()` tests shape, not identity, so it works everywhere.
70
+ > **Use `isApplicationError()`, never `instanceof ApplicationError`.** There is one `ApplicationError` class, defined in `@venizia/ignis-inversion`. `helpers` re-exports it, so a browser app can raise and read the same errors the server does. But `instanceof` still fails across a package boundary: inversion ships dual CJS+ESM builds, so one source class has two runtime constructors. `isApplicationError()` tests shape, not identity, so it works everywhere. The shape is an `Error` with a numeric `statusCode` and a `normalized` whose `text` is a string; a plain `Error` that only carries a `statusCode`, as an HTTP client's does, is not an `ApplicationError`.
71
71
 
72
72
  **Options shared by both forms**
73
73
 
@@ -304,6 +304,40 @@ The handler is fail-closed on environment. It exposes `stack` and `cause` in `de
304
304
  >
305
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.
306
306
 
307
+ ### Store the filled text where a plain reader shows it
308
+
309
+ `error.message` stays the template, so a reader that only knows `.message` - a job queue's failure reason, a third-party log - shows `%{key}`. Fill it where you hand the error over:
310
+
311
+ ```typescript
312
+ const error = getError({
313
+ message: { text: 'Only %{available} left of %{sku}.', code: 'stock.unavailable' },
314
+ messageArgs: { available: 2, sku: 'TRA-01' },
315
+ statusCode: 409,
316
+ });
317
+
318
+ error.toFilledText(); // 'Only 2 left of TRA-01.'
319
+ error.message; // 'Only %{available} left of %{sku}.' - unchanged
320
+ ```
321
+
322
+ For a BullMQ processor, which stores `job.failedReason = error.message`:
323
+
324
+ ```typescript
325
+ const processor = async (job: Job) => {
326
+ try {
327
+ return await handle(job);
328
+ } catch (error) {
329
+ throw isApplicationError(error) ? new Error(error.toFilledText(), { cause: error }) : error;
330
+ }
331
+ };
332
+ ```
333
+
334
+ Fill only where you choose to. A filled text carries every arg value inline, outside the `args` map a log redacts by key. `MessageTemplate.render({ text, args })` is the same fill, and also returns the keys it found no arg for.
335
+
336
+ > [!WARNING]
337
+ > `toFilledText()` is a method, so it exists only on a real `ApplicationError`. An error body read from a response is a plain object: `(body as ApplicationError).toFilledText()` compiles, then throws `toFilledText is not a function`. Rebuild it first with `fromError({ error: body }).toFilledText()`, or fill the shape directly with `MessageTemplate.render({ text: body.normalized?.text ?? '', args: body.normalized?.args }).text`. A response `message` is already filled by the server, so a client rarely needs either.
338
+ >
339
+ > For the same reason, an object literal typed `ApplicationError` - a test fixture, a mock - no longer compiles. Build it with `getError(...)`.
340
+
307
341
  ### Consume the error response from a browser client
308
342
 
309
343
  The error layer lives in `@venizia/ignis-inversion`, not in helpers, precisely so a browser app can
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@venizia/ignis-atlas",
3
- "version": "0.1.2-0",
3
+ "version": "0.1.2-2",
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,7 +60,7 @@
60
60
  },
61
61
  "dependencies": {
62
62
  "@hono/zod-openapi": "^1.6.3",
63
- "@venizia/ignis-helpers": "^0.2.2-0",
63
+ "@venizia/ignis-helpers": "^0.2.2-2",
64
64
  "zod": "^4.5.4"
65
65
  },
66
66
  "devDependencies": {