|
3 | 3 | import type { SemanticMigration } from '../../types.js'; |
4 | 4 |
|
5 | 5 | // The D3 entry for the save door's literal `ctx.text` reader reading the |
6 | | -// optional-call `ctx.text?.('key')` and non-null `ctx.text!('key')` shapes |
7 | | -// (ruling 6913660232 parameter 7: a key asked for literally that `texts` does |
8 | | -// not declare is refused at save). It narrows the hook's and the action's |
9 | | -// accept set; no key is removed, so there is no tombstone and no D2 |
10 | | -// conversion: which sentence the author meant is a judgement about the hook. |
| 6 | +// optional-call shape `ctx.text?.('key')` (ruling 6913660232 parameter 7: a |
| 7 | +// key asked for literally that `texts` does not declare is refused at save). |
| 8 | +// It narrows the hook's accept set, the released half; the action half |
| 9 | +// (`ActionSchema.texts`) ships already narrowed. No key is removed, so there is |
| 10 | +// no tombstone and no D2 conversion: which sentence the author meant is a |
| 11 | +// judgement about the hook. |
11 | 12 | export const entry: SemanticMigration = { |
12 | 13 | id: 'hook-action-text-key-optional-call-refused', |
13 | 14 | surface: |
14 | | - 'hook.body.source / hook.handler and action.body.source on a hook or a type: script action that declares ' |
15 | | - + 'texts: a literal ctx.text?.(KEY) or ctx.text!(KEY) call, awaited or not, whose KEY texts does not declare', |
| 15 | + 'hook.body.source / hook.handler on a hook that declares texts: a literal optional call ctx.text?.(KEY), ' |
| 16 | + + 'awaited or not, whose KEY texts does not declare. A type: script action\'s body.source is read the same ' |
| 17 | + + 'way from the release that introduces action texts, so no released action is affected', |
16 | 18 | replacement: |
17 | 19 | 'Declare the key under texts.KEY with the sentence the record keeps, or ask for one of the declared keys. ' |
18 | | - + 'The call shape is unchanged: ctx.text?.(KEY) and ctx.text!(KEY) stay legal for a declared key.', |
| 20 | + + 'The optional call stays legal for a declared key.', |
19 | 21 | reason: |
20 | | - 'A key a hook or an action asks for literally that its texts does not declare was refused at save only for ' |
21 | | - + 'the plain call ctx.text(KEY). The optional-call and non-null shapes, which strict TypeScript reaches for ' |
22 | | - + 'because HookContext.text is optional, passed the save, and the runtime refused the key only when the code ' |
23 | | - + 'ran, as a fault naming the hook or action and the key. The save now refuses them with the same sentence, ' |
24 | | - + 'at body.source (or handler). A key that arrives any other way (a variable, a computed name) is still ' |
25 | | - + 'judged when the code runs. There is no mechanical rewrite: the code already failed at run time for that ' |
26 | | - + 'key, and whether to declare it or ask for another is a judgement about the sentence.', |
| 22 | + 'A key a hook asks for literally that its texts does not declare was refused at save only for the plain ' |
| 23 | + + 'call ctx.text(KEY). The optional call ctx.text?.(KEY), which strict TypeScript reaches for because ' |
| 24 | + + 'HookContext.text is optional, passed the save, and the runtime refused the key only when the hook ran, ' |
| 25 | + + 'as a fault naming the hook and the key. The save now refuses it with the same sentence, at body.source ' |
| 26 | + + 'or handler. A key that arrives any other way (a variable, a computed name) is still judged when the code ' |
| 27 | + + 'runs. There is no mechanical rewrite: the hook already failed at run time for that key, and whether to ' |
| 28 | + + 'declare it or ask for another is a judgement about the sentence.', |
27 | 29 | acceptanceCriteria: |
28 | | - 'objectstack validate reports no issue at body.source or handler for any hook or action that declares texts, ' |
29 | | - + 'and every key its code asks for through ctx.text, ctx.text?.( or ctx.text!( is a key of its texts.', |
| 30 | + 'objectstack validate reports no issue at body.source or handler for any hook that declares texts, and ' |
| 31 | + + 'every key its code asks for through ctx.text or the optional call ctx.text?.( is a key of its texts.', |
30 | 32 | }; |
0 commit comments