Repository navigation
Commit e286fed
authored
🔒 Report the authored form on the invocation the engine issued (#569)
* 🔒 Report the authored form on the invocation the engine issued
A component whose two spellings do different things learns which one it is by
asking `Component.hasContent()`. That is a composable chain: its outermost
handler answers first, so middleware installed anywhere outside the invocation
answers ahead of the engine's own account of the element, and a handler that
answers per call can report one form to a caller checking and the other to the
component. `<File>` chooses between reading a file and writing over it with that
answer, so a self-closing `<File path="notes.md" />` could be made to render an
empty string over the file the document wrote a read for — in an ordinary
authored document, with no generated source anywhere near it.
The authored form is a fact about the invocation rather than about the
surroundings it runs in, so it now travels on the invocation. `ComponentInvocation`
gains `hasContent(): boolean`: synchronous, immutable, projecting nothing,
suspending on nothing, and spending no durable identity. The boolean is recorded
in the private issuance state when canonical execution mints the invocation and
read straight off it, so there is no context, map, registry entry or exported
lookup beside it — the only way to the fact is an object the engine handed over.
A component evaluated through a separately loaded copy therefore calls what it
received rather than a helper of its own copy.
Implementing the method does not make an object an invocation. Durable identity
stays the private field a claimant recognizes, so a structural look-alike
answering `hasContent()` still claims nothing.
`<File>` and workflow's `<Dir>` take their invocation and select their form only
from it. Both are irreversible in one direction, which is what separates them
from the components that merely render differently. There is no fallback: a call
arriving without a genuine invocation refuses before `cwd()`, before its
children, and therefore before any provider. Nothing else changes — the same
Files provider, the same content projection, the same lexical cwd, the same
failures and durable effects — and without hostile middleware the rendered
output, bindings and provider calls are what they were.
The contextual operation stays exported and composable. It remains the right
answer for a component deciding how to render; it is no longer the answer for
one deciding what to do.
Verified with the four boundary suites (10 tests, 104 steps) and
`deno task test --changed`, which selected 199 files and passed 494 tests in
21m28s. Reverting `<File>` to the contextual answer fails all four FL27/FL28
cases, including both exact toggles.
Refs #369
* 📄 Say what the contextual content answer does and does not guarantee
Two sentences claimed more than the code does.
The language specification said a component whose two forms select different
effects reads the authored form from its invocation. That describes `<File>` and
`<Dir>` and nothing else: every other component reads the contextual operation,
and saying otherwise reads as a rule the reader can rely on. It now states the
boundary as it is — only the invocation's own `hasContent()` is authoritative,
those two read it, and a component reading the contextual operation has no
authored-form guarantee at all.
The architecture said moving the remaining eleven consumers to the invocation is
a follow-up, and that until it happens they are held to the weaker rule. A
contract describes what is built, not what is planned. It now records only the
present terms: those eleven read the contextual answer, so middleware may alter
the effect, the guard or the retained data each of their branches decides, and
this invocation boundary makes no stronger guarantee for them. Which consumer
decides what is already enumerated beside it; the sequencing belongs in the
handback.
Documentation only: no source, test, assertion or test identifier changes.
Refs #369
---------
Co-authored-by: Taras Mankovski <[email protected]>1 parent 1b3126a commit e286fed
12 files changed
Lines changed: 731 additions & 29 deletions
File tree
- packages
- core
- src
- components
- tests
- fixtures/invocation-identity
- workflow
- src/composition/components
- tests
- specs
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2561 | 2561 | | |
2562 | 2562 | | |
2563 | 2563 | | |
| 2564 | + | |
| 2565 | + | |
| 2566 | + | |
| 2567 | + | |
| 2568 | + | |
| 2569 | + | |
| 2570 | + | |
| 2571 | + | |
| 2572 | + | |
| 2573 | + | |
| 2574 | + | |
| 2575 | + | |
| 2576 | + | |
| 2577 | + | |
| 2578 | + | |
| 2579 | + | |
| 2580 | + | |
| 2581 | + | |
| 2582 | + | |
| 2583 | + | |
| 2584 | + | |
| 2585 | + | |
| 2586 | + | |
| 2587 | + | |
| 2588 | + | |
| 2589 | + | |
| 2590 | + | |
| 2591 | + | |
| 2592 | + | |
| 2593 | + | |
| 2594 | + | |
| 2595 | + | |
2564 | 2596 | | |
2565 | 2597 | | |
2566 | 2598 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
91 | 94 | | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
92 | 103 | | |
93 | 104 | | |
94 | | - | |
| 105 | + | |
95 | 106 | | |
96 | 107 | | |
97 | 108 | | |
| |||
114 | 125 | | |
115 | 126 | | |
116 | 127 | | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
117 | 148 | | |
118 | 149 | | |
119 | 150 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2864 | 2864 | | |
2865 | 2865 | | |
2866 | 2866 | | |
2867 | | - | |
| 2867 | + | |
| 2868 | + | |
| 2869 | + | |
| 2870 | + | |
| 2871 | + | |
| 2872 | + | |
| 2873 | + | |
| 2874 | + | |
| 2875 | + | |
| 2876 | + | |
| 2877 | + | |
| 2878 | + | |
2868 | 2879 | | |
2869 | 2880 | | |
2870 | 2881 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
66 | 71 | | |
67 | 72 | | |
68 | 73 | | |
| |||
71 | 76 | | |
72 | 77 | | |
73 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
74 | 97 | | |
75 | 98 | | |
76 | 99 | | |
| |||
164 | 187 | | |
165 | 188 | | |
166 | 189 | | |
| 190 | + | |
| 191 | + | |
167 | 192 | | |
168 | 193 | | |
169 | 194 | | |
| |||
191 | 216 | | |
192 | 217 | | |
193 | 218 | | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
194 | 233 | | |
195 | 234 | | |
196 | 235 | | |
| |||
205 | 244 | | |
206 | 245 | | |
207 | 246 | | |
| 247 | + | |
208 | 248 | | |
209 | 249 | | |
210 | 250 | | |
211 | 251 | | |
| 252 | + | |
212 | 253 | | |
213 | 254 | | |
214 | 255 | | |
| |||
0 commit comments