|
1 | 1 | // Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license. |
2 | 2 |
|
3 | | -/** [#25467 cut 8] HEADER PLACEHOLDER */ |
| 3 | +/** |
| 4 | + * [#25467 cut 8] The runtime authoring gate of `ObjectStackProtocolImplementation` |
| 5 | + * and the restored-body doors that run it — the plugin-registered authoring |
| 6 | + * gate (`runAuthoringGate`), the shared runtime authoring rules with the |
| 7 | + * collections, package scope and host facts they are judged against |
| 8 | + * (`assertRuntimeAuthoringRules`), and the restore path's body derivation, |
| 9 | + * writer and save-door refusal (`restoredBodyDerivation`, `restoredBodyWriter`, |
| 10 | + * `refuseRestoredBodyTheSaveDoorRefuses`) — moved out of `protocol.ts` whole. |
| 11 | + * The other class members these bodies call are reached through the host |
| 12 | + * below and did not move: the credential channel, the stored-collection fold, |
| 13 | + * the package scope and the host-fact reads belong to groups of their own |
| 14 | + * (the save-door refusals among them already have theirs, cut 6). |
| 15 | + * |
| 16 | + * A MOVE, not a redesign. Each function below is the body of the |
| 17 | + * `ObjectStackProtocolImplementation` method of the same name as it stood, |
| 18 | + * re-indented one level and otherwise unedited: the same reads, made as the |
| 19 | + * same principal, refusing exactly where they did with the same codes and |
| 20 | + * messages. No module-level declaration is read by these bodies alone, so |
| 21 | + * none moved with them. |
| 22 | + * |
| 23 | + * ## How the moved bodies reach the class |
| 24 | + * |
| 25 | + * The shape #23050 set for `rest-server.ts` (its `data-action-routes.ts` |
| 26 | + * header carries the full reasoning), as `protocol-batch-data.ts` applies it. |
| 27 | + * The class keeps every method — the published `dist/*.d.ts` lists each one's |
| 28 | + * name, docblock and declared signature — and each body is one literal of |
| 29 | + * exactly the {@link AuthoringGateHost} members that method reads, plus a |
| 30 | + * `.call`. A method is handed over as a closure that calls it on the protocol |
| 31 | + * at call time, so a test double or spy set on the instance is still the one |
| 32 | + * the body reaches, and the moved bodies that call one another do so through |
| 33 | + * the protocol, exactly as before. |
| 34 | + * |
| 35 | + * The fields the bodies read, `engine`, `authoringChannel` and |
| 36 | + * `authoringGates`, go as GETTERS, so each read happens when the body makes |
| 37 | + * it: tests replace them on a constructed protocol. |
| 38 | + * |
| 39 | + * The other module-level declarations the bodies read |
| 40 | + * (`permissionSetOwnerBindingRefusal`, `runtimeHookWithoutBodyRefusal`) stay in |
| 41 | + * `protocol.ts`, where code that did not move reads them too, and are imported |
| 42 | + * from there: the module cycle is evaluation-safe because each is read only |
| 43 | + * inside a function body, never while the two modules are first evaluated. |
| 44 | + * `index.ts` names what it publishes from `protocol.ts` one by one, so the |
| 45 | + * `export` they gained for this keeps them off the published surface, and |
| 46 | + * nothing re-exports this module, so the published surface does not move. |
| 47 | + */ |
4 | 48 |
|
5 | 49 | import type { ObjectStackProtocolImplementation } from './protocol.js'; |
6 | 50 | import { permissionSetOwnerBindingRefusal, runtimeHookWithoutBodyRefusal } from './protocol.js'; |
|
0 commit comments