@orkestrel/scaffold 0.0.113 → 0.0.115

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 (94) hide show
  1. package/dist/agents/skills/orkestrel-publish/scripts/wave.js +83 -16
  2. package/dist/bin/main.js +71 -23
  3. package/dist/bin/main.js.map +1 -1
  4. package/dist/host/agents/orchestration.md +5 -3
  5. package/dist/host/agents/platforms/windows.md +1 -0
  6. package/dist/host/agents/skills/orkestrel-align/references/integration.md +1 -1
  7. package/dist/host/agents/skills/orkestrel-debrief/SKILL.md +4 -4
  8. package/dist/host/agents/skills/orkestrel-dispatch/SKILL.md +4 -1
  9. package/dist/host/agents/skills/orkestrel-falsify/SKILL.md +8 -2
  10. package/dist/host/agents/skills/orkestrel-harden/references/equivalence.md +1 -0
  11. package/dist/host/agents/skills/orkestrel-harden/references/hardening.md +1 -1
  12. package/dist/host/agents/skills/orkestrel-parallel/SKILL.md +1 -1
  13. package/dist/host/agents/skills/orkestrel-parallel/references/codex.md +1 -0
  14. package/dist/host/agents/skills/orkestrel-publish/SKILL.md +7 -7
  15. package/dist/host/agents/skills/orkestrel-publish/references/wave.md +31 -11
  16. package/dist/host/agents/skills/orkestrel-publish/scripts/wave.ts +150 -49
  17. package/dist/host/claude/agents/analyst.md +1 -1
  18. package/dist/host/claude/agents/astra.md +2 -2
  19. package/dist/host/claude/agents/builder.md +4 -4
  20. package/dist/host/claude/agents/opus.md +3 -3
  21. package/dist/host/claude/agents/orkestrel.md +57 -59
  22. package/dist/host/claude/agents/planner.md +8 -2
  23. package/dist/host/claude/rules/campaign.md +2 -1
  24. package/dist/host/claude/rules/documentation.md +1 -0
  25. package/dist/host/claude/rules/tests.md +13 -8
  26. package/dist/host/claude/rules/workspace.md +28 -28
  27. package/dist/host/claude/rules/writing.md +1 -0
  28. package/dist/host/claude/skills/enterprise-bootstrap/SKILL.md +1 -2
  29. package/dist/host/claude/skills/orkestrel-align/SKILL.md +1 -1
  30. package/dist/host/claude/skills/orkestrel-build/SKILL.md +1 -2
  31. package/dist/host/claude/skills/orkestrel-debrief/SKILL.md +1 -2
  32. package/dist/host/claude/skills/orkestrel-dispatch/SKILL.md +1 -1
  33. package/dist/host/claude/skills/orkestrel-falsify/SKILL.md +1 -1
  34. package/dist/host/claude/skills/orkestrel-harden/SKILL.md +1 -1
  35. package/dist/host/claude/skills/orkestrel-journey/SKILL.md +1 -1
  36. package/dist/host/claude/skills/orkestrel-parallel/SKILL.md +1 -1
  37. package/dist/host/claude/skills/orkestrel-polish/SKILL.md +1 -2
  38. package/dist/host/claude/skills/orkestrel-publish/SKILL.md +1 -2
  39. package/dist/host/claude/skills/orkestrel-scout/SKILL.md +1 -1
  40. package/dist/host/codex/agents/analyst.toml +8 -5
  41. package/dist/host/codex/agents/astra.toml +4 -5
  42. package/dist/host/codex/agents/builder.toml +5 -5
  43. package/dist/host/codex/agents/opus.toml +3 -4
  44. package/dist/host/codex/agents/orkestrel.toml +2 -1
  45. package/dist/host/codex/agents/planner.toml +8 -5
  46. package/dist/host/codex/agents/reviewer.toml +5 -4
  47. package/dist/host/guides/agent.md +13 -13
  48. package/dist/host/guides/brief.md +4 -0
  49. package/dist/host/guides/browser.md +162 -44
  50. package/dist/host/guides/budget.md +1 -1
  51. package/dist/host/guides/capture.md +4 -0
  52. package/dist/host/guides/console.md +13 -0
  53. package/dist/host/guides/contract.md +38 -3
  54. package/dist/host/guides/csv.md +5 -0
  55. package/dist/host/guides/database.md +58 -8
  56. package/dist/host/guides/form.md +17 -0
  57. package/dist/host/guides/guide.md +36 -33
  58. package/dist/host/guides/html.md +72 -44
  59. package/dist/host/guides/indexeddb.md +4 -0
  60. package/dist/host/guides/lsp.md +49 -8
  61. package/dist/host/guides/markdown.md +146 -1
  62. package/dist/host/guides/mcp.md +117 -22
  63. package/dist/host/guides/middleware.md +194 -26
  64. package/dist/host/guides/msg.md +9 -5
  65. package/dist/host/guides/pool.md +8 -1
  66. package/dist/host/guides/probe.md +13 -1
  67. package/dist/host/guides/process.md +102 -90
  68. package/dist/host/guides/program.md +4 -0
  69. package/dist/host/guides/qualifier.md +4 -0
  70. package/dist/host/guides/rater.md +4 -0
  71. package/dist/host/guides/reason.md +6 -4
  72. package/dist/host/guides/relation.md +4 -0
  73. package/dist/host/guides/scaffold.md +32 -14
  74. package/dist/host/guides/server.md +29 -13
  75. package/dist/host/guides/sqlite.md +6 -0
  76. package/dist/host/guides/sse.md +6 -0
  77. package/dist/host/guides/study.md +473 -473
  78. package/dist/host/guides/table.md +3 -0
  79. package/dist/host/guides/template.md +3 -0
  80. package/dist/host/guides/test.md +38 -20
  81. package/dist/host/guides/tool.md +3 -0
  82. package/dist/host/guides/toolbox.md +21 -0
  83. package/dist/host/guides/websocket.md +3 -1
  84. package/dist/host/guides/workflow.md +103 -11
  85. package/dist/host/guides/workspace.md +4 -0
  86. package/dist/host/manifest.json +84 -84
  87. package/dist/host/tests/config.test.ts +7 -13
  88. package/dist/src/core/index.cjs +20 -28
  89. package/dist/src/core/index.cjs.map +1 -1
  90. package/dist/src/core/index.d.cts +7 -7
  91. package/dist/src/core/index.d.ts +7 -7
  92. package/dist/src/core/index.js +20 -28
  93. package/dist/src/core/index.js.map +1 -1
  94. package/package.json +12 -12
@@ -227,7 +227,7 @@ In a guard table a `Shape` cell holds the type the guard narrows to.
227
227
  | API | Kind | Shape | Summary |
228
228
  | -------------------------- | -------- | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
229
229
  | `isReasoning` | const | `Reasoning` | Determines whether a value is a `Reasoning` literal. |
230
- | `isChainingStrategy` | const | `ChainingStrategy` | Determines whether a value is a `ChainingStrategy` literal. |
230
+ | `isChainStrategy` | const | `ChainStrategy` | Determines whether a value is a `ChainStrategy` literal. |
231
231
  | `isMathOperation` | const | `MathOperation` | Determines whether a value is a `MathOperation` literal. |
232
232
  | `isAggregation` | const | `Aggregation` | Determines whether a value is an `Aggregation` literal. |
233
233
  | `isComparison` | const | `Comparison` | Determines whether a value is a `Comparison` literal. |
@@ -278,6 +278,8 @@ In a guard table a `Shape` cell holds the type the guard narrows to.
278
278
  | `ReasonError` | class | Represents an error thrown by the reasons layer. |
279
279
  | `isReasonError` | function | Narrows an unknown caught value to a `ReasonError`. |
280
280
 
281
+ `ReasonError` carries an own non-enumerable, non-writable, self-valued brand under `Symbol.for('@orkestrel/reason.ReasonError')`. Its guard accepts errors from another installed copy and subclasses regardless of `name`. It requires an instance of the global `Error` with a prototype other than `Error.prototype`, the own brand, a declared `code`, and valid members. It rejects unbranded look-alikes, transparent proxies, and plain objects carrying only the brand. Hostile reads return false.
282
+
281
283
  ### Constants
282
284
 
283
285
  A `Shape` cell holds the constant's declared type.
@@ -311,7 +313,7 @@ A `Shape` cell holds an interface's data members as bare names in braces, `?` ma
311
313
  | Type | Kind | Shape | Summary |
312
314
  | ----------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
313
315
  | `Reasoning` | type | `'quantitative' \| 'logical' \| 'symbolic' \| 'inferential'` | Names the reasoning strategies — the axis a `Definition` and a `ReasonResult` discriminate on. |
314
- | `ChainingStrategy` | type | `'forward' \| 'backward'` | Names how a chaining reasoner walks its rules: `forward` (data-driven fixpoint) or `backward` (goal-driven proving). |
316
+ | `ChainStrategy` | type | `'forward' \| 'backward'` | Names how a chaining reasoner walks its rules: `forward` (data-driven fixpoint) or `backward` (goal-driven proving). |
315
317
  | `MathOperation` | type | `'add' \| 'subtract' \| 'multiply' \| 'divide' \| 'percentage' \| 'minimum' \| 'maximum' \| 'average' \| 'power' \| 'round' \| 'ceil' \| 'floor' \| 'abs'` | Names a math operation applied by the `TransformerInterface` and inside `SymbolicExpression` trees. |
316
318
  | `Aggregation` | type | `'sum' \| 'product' \| 'average' \| 'minimum' \| 'maximum'` | Names how the `AggregatorInterface` reduces a list of numbers to one. |
317
319
  | `Comparison` | type | `'equals' \| 'not' \| 'above' \| 'below' \| 'from' \| 'to' \| 'any' \| 'none' \| 'between' \| 'outside'` | Names the comparison a `Check` applies between a resolved subject field and its expected value. |
@@ -350,8 +352,8 @@ A `Shape` cell holds an interface's data members as bare names in braces, `?` ma
350
352
  | `LogicalClearKey` | type | `'description' \| 'depth'` | Names the optional `LogicalDefinition` fields `clearLogicalDefinition` (and a logical `DefinitionBuilderInterface`'s `clear`) can delete. |
351
353
  | `SymbolicClearKey` | type | `'description' \| 'precision'` | Names the optional `SymbolicDefinition` fields `clearSymbolicDefinition` (and a symbolic `DefinitionBuilderInterface`'s `clear`) can delete. |
352
354
  | `InferentialClearKey` | type | `'description' \| 'depth'` | Names the optional `InferentialDefinition` fields `clearInferentialDefinition` (and an inferential `DefinitionBuilderInterface`'s `clear`) can delete. |
353
- | `LogicalChainingResult` | interface | `{ conclusion, rules }` | Represents one chaining pass of the `LogicalReasoner` — the overall `conclusion` plus the per-rule results the pass produced. |
354
- | `InferentialChainingResult` | interface | `{ derived, proof? }` | Represents one chaining pass of the `InferentialReasoner` — the facts the pass derived plus the proof tree, when the pass produced one. |
355
+ | `LogicalChainResult` | interface | `{ conclusion, rules }` | Represents one chaining pass of the `LogicalReasoner` — the overall `conclusion` plus the per-rule results the pass produced. |
356
+ | `InferentialChainResult` | interface | `{ derived, proof? }` | Represents one chaining pass of the `InferentialReasoner` — the facts the pass derived plus the proof tree, when the pass produced one. |
355
357
  | `FactorResult` | interface | `{ id, applied, value, raw?, checks? }` | Represents one factor's evaluation outcome. |
356
358
  | `GroupResult` | interface | `{ id, applied, value, factors }` | Represents one group's evaluation outcome — its clamped value and the per-factor results (disabled factors omitted entirely). |
357
359
  | `QuantitativeResult` | interface | `{ reasoning, value, groups, count, success, trace, errors }` | Represents the outcome of quantitative reasoning. |
@@ -79,6 +79,10 @@ acme?.contacts // the relation property — broad (Row | readonly Row[] | undefi
79
79
 
80
80
  ### Types
81
81
 
82
+ The error guard recognizes the error's own identity brand across package copies and
83
+ module formats. It accepts subclasses regardless of their `name` and refuses
84
+ transparent proxies, unbranded look-alikes, and plain branded objects.
85
+
82
86
  A `Shape` cell holds an interface's data members as bare names in braces, `?` marking an optional member and `plus` introducing its call-signature members, and a type alias's own type literal with a union's arms escaped as `\|`. An extended interface's name comes before `plus`, with the members it adds after.
83
87
 
84
88
  | Type | Kind | Shape | Summary |
@@ -837,6 +837,13 @@ reconcile the declared ranges and write the script region on every run, whatever
837
837
  names. A run scoped to `manifest` for a script write takes the reconciled `@orkestrel/*`
838
838
  ranges with it, and a run that excludes `manifest` still takes the ranges and the scripts.
839
839
 
840
+ Before resolving overwrite's version ranges, the declaration step lifts each planned foreign tool
841
+ whose `devDependencies` major is earlier than the canon's to the blueprint's planned range,
842
+ including selected framework holds. An equal or later declared major stays, as does a disjunction
843
+ with an arm at the planned major, and a `dependencies` declaration never lifts. The version lookup then searches within the selected major. Offline
844
+ overwrite writes the planned floor; an online lookup can raise its minor or patch. Peers remain
845
+ unchanged.
846
+
840
847
  A value matching neither is a script the workspace author wrote. The region writer retains that
841
848
  value byte-for-byte and reports its name, declared value, and planned value. Each other planned
842
849
  script is decided independently: an absent script appends, the planned value stands, and an accepted
@@ -962,14 +969,17 @@ standard error, so a piped value is never polluted.
962
969
  | `audit` | `Audit` — `findings` and `questions` — plus `releases` and `provenance`; findings carry `ownership` |
963
970
  | `repair` | `MaterializeResult` plus `audit`, the terminal audit taken after the write, `releases`, and `provenance` |
964
971
  | `catalog` | `MaterializeResult` plus `mirrors`, `provenance`, optional `membership` with `entries`, `dropped`, and `releases`, and an explanatory `note` on a partial run |
965
- | `overwrite` | The `catalog` value plus `audit`, top-level `releases` from its version read, and `additions`; `note` explains a partial run |
972
+ | `overwrite` | The `catalog` value plus `audit`, top-level `releases` from its version read, `additions`, and `lifts`; `note` explains a partial run |
966
973
 
967
974
  The `membership` entity is present only when the catalog read completes. Its `entries` holds the
968
975
  package table, `dropped` names packages the preceding table carried that the registry no longer
969
976
  lists, and `releases` measures declared fleet ranges against the catalog read. The `overwrite`
970
977
  result also retains top-level `releases` from its separate version read, including foreign tools,
971
978
  and `additions`, the `DependencyPinSet` of planned dependencies it declared, empty when the
972
- manifest lacked none.
979
+ manifest lacked none. Its `lifts` list names each tool whose major the run lifted, with the
980
+ declared range in `from` and the written range in `to`, and is empty when no lift landed. The human
981
+ report prints `Lifted "<name>" from "<from>" to "<to>". Run npm install to install it.` for each
982
+ lift. The version evidence in `releases` uses the range selected for the lookup, after any lift.
973
983
  An absent `membership` identifies an incomplete catalog read; `note` explains the cause.
974
984
 
975
985
  The following JSON excerpt shows the membership evidence in a completed catalog result:
@@ -1135,13 +1145,12 @@ end-to-end proof that no study engine drives is an integration test instead. It
1135
1145
  `tests/integration.test.ts` when it crosses environments.
1136
1146
  The project loads `tests/setup.ts` alone. The tests import
1137
1147
  `tests/setupStudy.ts`, a harness module the package owns, so scaffold plans no such file and no
1138
- project loads it as a setup file. A publishing workspace invokes the project from `prepublishOnly`,
1139
- after `npm test` and before the release proof; a `private: true` workspace invokes it from `test`,
1140
- before the live-service project. Its longer timeouts and disabled file parallelism match the
1148
+ project loads it as a setup file. In publishing and `private: true` workspaces, run the project on
1149
+ demand with `npm run test:studies` alone; no gate or chain runs it.
1150
+ Its longer timeouts and disabled file parallelism match the
1141
1151
  live-service project. The root `studies/` directory holds the adapters and declarations the study
1142
- tests run, and it selects nothing. A `prepublishOnly` chain written before the fact existed upgrades
1143
- in place: the generated chain without its study step, and without both its study step and the release
1144
- proof, are accepted predecessors.
1152
+ tests run, and it selects nothing. A chain that carries a study step fails the configuration proof
1153
+ until the workspace removes that step during scaffold adoption.
1145
1154
 
1146
1155
  `tree` says the workspace holds the exact-case `tests/tree.test.ts` proof, and it alone registers
1147
1156
  the `tree` Vitest project over that file and its `test:tree` script, which `test` invokes in a
@@ -2007,8 +2016,13 @@ capture. A browser source, styles surface, or browser setup without that journey
2007
2016
  receives no capture seed. A runtime declaration remains in its existing section instead of
2008
2017
  being duplicated as a development dependency.
2009
2018
 
2010
- Outside the selected showcase pair, a newer major is never crossed for you. `audit` reports one as a non-blocking `dependencies`
2011
- question, and a person decides whether the generated toolchain supports it.
2019
+ `audit` reports a later registry major as a non-blocking `dependencies` question. Outside the
2020
+ selected showcase pair, `repair` keeps the declared major. `overwrite` lifts an earlier declared
2021
+ foreign `devDependencies` major to the blueprint's planned range; it does not select an arbitrary
2022
+ later registry major, and it never lifts a `dependencies` declaration. It reads a major only from
2023
+ `^MAJOR` or a full version, optionally under `^` or `~`. A disjunction lifts only when every arm
2024
+ names a readable major earlier than the planned major. A range whose major cannot be read, or one
2025
+ longer than `MAX_RANGE_LENGTH`, stays declared.
2012
2026
 
2013
2027
  `TOOLCHAIN_HOLDS` records framework-specific ranges. `blueprintToToolchainHolds` selects those
2014
2028
  rows from the blueprint's occupied browser framework faces. A `src/vue` or `app/vue` face selects
@@ -2017,7 +2031,9 @@ TypeScript `^6.0.3`: no stable `vue-tsc` runs on TypeScript 7, `vue-tsc` resolve
2017
2031
  directs Vue projects to stay on TypeScript 6.0. Every workspace without that extension receives TypeScript `^7.0.2`.
2018
2032
  For a selected hold, `audit` reports the hold and its reason in place of the newer-major question
2019
2033
  and reports a declaration past the hold. A non-Vue workspace on TypeScript 7 raises no hold
2020
- question. The constants proof ties each hold to its framework's planned range and scaffold's
2034
+ question. Overwrite uses the held range as its lift target: TypeScript 6 stays at that major in a
2035
+ Vue workspace, while TypeScript 6 lifts to 7 in a workspace without Vue. A declaration already
2036
+ past the hold stays declared; overwrite does not downgrade it. The constants proof ties each hold to its framework's planned range and scaffold's
2021
2037
  manifest baseline. Prove the framework on the later major before lifting its hold.
2022
2038
 
2023
2039
  The dependency tables select these floors:
@@ -2738,9 +2754,11 @@ projects. Scaffold also seeds proofs for its own setup modules, as Root setup mi
2738
2754
 
2739
2755
  Registration follows the same split. Scaffold registers `conformance`, `tree`, `studies`, and
2740
2756
  `service` when their structural facts are set, and registers `distribution` whenever the workspace
2741
- publishes at least one `src` environment or sheet face. In a publishing workspace, `distribution`,
2742
- `studies`, and `service` run from `prepublishOnly`, and `conformance` and `tree` stay in `test`. In a `private: true` workspace, `distribution` is absent,
2743
- `studies` and then `service` run from `test`, and there is no `prepublishOnly` at all. The `policy` project reports an exporting root setup module that lacks its sibling proof or an import from `tests/setup.test.ts`.
2757
+ publishes at least one `src` environment or sheet face. In a publishing workspace, `distribution`
2758
+ and `service` run from `prepublishOnly`, and `conformance` and `tree` stay in `test`. In a
2759
+ `private: true` workspace, `distribution` is absent, `service` runs from `test`, and there is no
2760
+ `prepublishOnly`. In both kinds of workspace, `studies` runs on demand through `npm run test:studies`
2761
+ alone, outside every gate and chain. The `policy` project reports an exporting root setup module that lacks its sibling proof or an import from `tests/setup.test.ts`.
2744
2762
  Separately, a filled, exporting `tests/setup*.ts` module that no `tests/setup*.test.ts`
2745
2763
  proof covers raises the non-blocking `setup` question in `audit`, which names the modules and the proof to add.
2746
2764
  For setup modules the workspace authors, the workspace supplies the behavior proof; the setup modules scaffold seeds arrive with their sibling proofs.
@@ -64,6 +64,17 @@ Cross-face and substrate usage appear under [Patterns](#patterns).
64
64
  | `createServer` | function | Creates a `ServerInterface` — the node face's HTTP server facade over a consumed `@orkestrel/router` dispatcher. |
65
65
  | `createStream` | function | Creates a `StreamInterface` — a generic Server-Sent-Events stream whose `response` is a fetch-standard streaming `Response` a route returns. |
66
66
 
67
+ ### Startup ownership
68
+
69
+ | API | Kind | Shape | Summary |
70
+ | --------------- | ----- | ------------------------- | --------------------------------------------------------------------------- |
71
+ | `ServerBinding` | class | `new () => ServerBinding` | Owns one startup attempt's listening subscription and validated bound port. |
72
+
73
+ `Server` creates a binding per startup attempt. It retains the listening promise through failure
74
+ cleanup and records the native address before publishing the port. The error listener is installed
75
+ before cancellation, pending-listener settlement precedes forced close, and signal and deadline
76
+ cleanup finish before the start event is emitted.
77
+
67
78
  ### Constants
68
79
 
69
80
  A `Shape` cell holds the constant's declared type.
@@ -122,7 +133,7 @@ A `Shape` cell holds the constant's declared type.
122
133
  | `parseEncoding` | function | Parses a raw `Content-Encoding` header value into a decompressible `Encoding` — the boundary `readBody` coerces through to decide whether a request body needs transparent decompression. |
123
134
  | `decompressRequestBody` | function | Decompresses an already-collected, `gzip`/`deflate`-encoded byte sequence transparently through `DecompressionStream`, capping the decompressed output — the zip-bomb defense. |
124
135
  | `readBody` | function | Collects and decodes a `Request` body — the shared body-collection pipeline surfaced to middleware and handlers as the middleware context's cached `body()`. An empty body and a malformed `application/json` body each decode to `undefined`. |
125
- | `isHTTPError` | function | Narrows an unknown caught value to an `HTTPError`, including a subclass such as `ContentTooLargeError`, and recognizes an instance from another copy of this package through a structural brand fallback. |
136
+ | `isHTTPError` | function | Narrows an unknown caught value to an `HTTPError`, including a subclass such as `ContentTooLargeError`, and recognizes an instance from another copy of this package through its own identity brand. |
126
137
  | `isServerError` | function | Narrows an unknown caught value to a `ServerError` — the code-bearing refusal of a call the caller programmed. |
127
138
  | `isAddressInfo` | function | Checks whether a `node:net` `server.address()` return is the structured `AddressInfo` (carrying a numeric `port`) rather than a pipe `string` or `null` — the total, never-throwing narrow `discoverPort` and the `Server`'s own port resolution read the bound port through. |
128
139
  | `probePort` | function | Binds and closes a throwaway TCP server to resolve one available port. |
@@ -176,6 +187,18 @@ Each interface's `readonly` data members stay Surface rows, and its call-signatu
176
187
  members are documented under [Methods](#methods). `ServerInterface.address` is the
177
188
  bound node `AddressInfo` while the listener is active and `undefined` otherwise.
178
189
 
190
+ ### Error identity and body iteration
191
+
192
+ The error guards and request readers expose these primitives.
193
+
194
+ | API | Kind | Summary |
195
+ | ------------------------------- | -------- | ------------------------------------------------------------------------------------- |
196
+ | `SERVER_ERROR_BRAND` | const | Names the identity brand carried by lifecycle errors across package copies. |
197
+ | `CONTENT_TOO_LARGE_ERROR_BRAND` | const | Names the identity brand carried by body-limit errors across package copies. |
198
+ | `isContentTooLargeError` | function | Recognizes a branded body-limit error, including subclasses and other package copies. |
199
+ | `iterateMediaMatches` | function | Yields matching media ranges through the first exact rejection. |
200
+ | `iterateRequestBody` | function | Yields the same lazily collected request-body promise on every read. |
201
+
179
202
  ## Methods
180
203
 
181
204
  The public methods of `NegotiatorInterface`, `StreamInterface`, and
@@ -455,18 +478,11 @@ These invariants hold across `src/server` ↔ `server.md`.
455
478
  `'Internal Server Error'` string unless `expose` is explicitly `true`; an
456
479
  `HTTPError`'s own `message` is always client-facing (it is the handler's
457
480
  deliberate signal), independent of `expose`.
458
- 18. **`isHTTPError` recognizes an `HTTPError` across package copies, not only
459
- `instanceof`.** A version-skewed or workspace-linked duplicate install of
460
- this package produces a second, distinct `HTTPError` constructor —
461
- `instanceof` fails across the copies even though the thrown value is
462
- structurally identical, which would otherwise collapse a deliberate 4xx
463
- into the built-in boundary's 500 fallback. `isHTTPError` tries
464
- `instanceof` first, then falls back to a total structural check: the
465
- value must carry a stable cross-copy brand (a `Symbol.for`-interned key,
466
- so every copy resolves the same symbol) and expose a numeric `status` and
467
- a string `message` — the exact fields the boundary reads off a
468
- recognized error. The brand is an implementation detail of `HTTPError`'s
469
- constructor, not a field a consumer sets by hand.
481
+ 18. **Error guards recognize independent package copies through an own identity brand.**
482
+ A recognized value is a global Error with a derived prototype. Its own brand holds the
483
+ value itself. The guard checks the declared status or code, message, and optional context.
484
+ Object and callable contexts are accepted. Subclass names are unrestricted. Transparent
485
+ proxies, unbranded look-alikes, and branded plain objects are rejected.
470
486
  19. **SSE producers can cooperate with real process-local transport
471
487
  backpressure.** `StreamInterface.write` returns `true` only while the
472
488
  underlying `ReadableStream` controller retains positive desired size after
@@ -62,6 +62,12 @@ A `Shape` cell holds the constant's declared type.
62
62
  | `SQLiteError` | class | Represents an error thrown by the SQLite wrapper, carrying a machine-readable `code` — `CLOSED`, `CONSTRAINT`, `BUSY`, `INVALID`, or `UNKNOWN`. |
63
63
  | `isSQLiteError` | function | Checks whether a value is a `SQLiteError`. |
64
64
 
65
+ `isSQLiteError` recognizes the own identity brand and declared members across package copies
66
+ and module formats. It accepts subclass instances without requiring their name and refuses
67
+ unbranded look-alikes, transparent proxies, and objects carrying only the brand. The constructor
68
+ stores the error itself under `Symbol.for('@orkestrel/sqlite.SQLiteError')` as a non-enumerable,
69
+ non-writable own property.
70
+
65
71
  ### Types
66
72
 
67
73
  A `Shape` cell holds an interface's data members as bare names in braces, `?` marking an optional member and `plus` introducing its call-signature members, and a type alias's own type literal with a union's arms escaped as `\|`.
@@ -85,6 +85,12 @@ try {
85
85
  }
86
86
  ```
87
87
 
88
+ `isSSEError` recognizes the own identity brand and declared members across package copies
89
+ and module formats. It accepts subclass instances without requiring their name and refuses
90
+ unbranded look-alikes, transparent proxies, and objects carrying only the brand. The constructor
91
+ stores the error itself under `Symbol.for('@orkestrel/sse.SSEError')` as a non-enumerable,
92
+ non-writable own property.
93
+
88
94
  ### Factories
89
95
 
90
96
  | API | Kind | Summary |