Skip to content

Commit 0903a2f

Browse files
committed
πŸ“„ Describe the return boundary the engine actually has
The glossary row and the "Definition-owned return state" section still described the frozen carrier in a named context β€” the design the direct-import attack retired two commits ago. Both now say what the code does: ownership travels down the expansion call stack as a local, no exported function accepts another body's, and importing the module that defines one gets a document a body of its own, connected to no execution. The rejected shape stays in the text as the reason: a sealed carrier in a context plus an exported `claim(carrier)` is forgeable however carefully the carrier is sealed, because the document calls the engine's own helper with the engine's own carrier. Without that sentence this reads like an odd way to pass a parameter, and the simplification back to a context is an easy one to make twice. Documentation only. No runtime behavior changed. Refs #640
1 parent 1925554 commit 0903a2f

1 file changed

Lines changed: 23 additions & 14 deletions

File tree

β€Žarchitecture.mdβ€Ž

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ Existing documents and code get aligned to this section retroactively.
108108
| syntax catalog | the complete, versioned description of what a document may write in one directory under one host profile: every structural construct the engine reserves, and the one implementation selection chooses for every other name. It is observation β€” describing an environment installs no operational state, runs nothing and journals nothing β€” and it is produced once per request and projected, never rediscovered per format |
109109
| run profile declarations | the component registrations a first-party package makes, held as plain values apart from the middleware, providers, activation and launchers its installer also arranges. The installer registers exactly those values and inspection reads exactly those values, so what a run installs and what the catalog reports cannot drift |
110110
| origin-only | the inspectability of a component whose contract could only be learned by loading it: a repository TypeScript module, whose schemas live on its exports and whose top level would run. Such an entry carries name, category, origin and source kind, and no contract field at all β€” an absent contract is stated, never rendered as an empty one |
111-
| definition-owned return state | which value body a `<Return>` selects for: one ephemeral state per execution of one value root or Markdown value component. Structural directives keep the ambient one, a component invocation hides it from the invoked body, a nested value body installs its own, and caller-projected content restores the caller's. What travels contextually is a frozen carrier holding no facts, only an accessor that answers nothing without a token this module never exports; the state lives in that carrier's closure, so a document can read, enumerate, copy or replace the carrier and reach nothing. The first claim on it is atomic, so a second executed return fails the body rather than replacing its value, and it appends no durable event |
111+
| definition-owned return state | which value body a `<Return>` selects for: one ephemeral state per execution of one value root or Markdown value component. Structural directives keep the ambient one, a component invocation hides it from the invoked body, a nested value body installs its own, and caller-projected content restores the caller's. It travels down the expansion call stack as a local rather than through a context, and no exported function accepts another body's, so nothing a document can read, replace, or import acts on a live one. The first claim on it is atomic, so a second executed return fails the body rather than replacing its value, and it appends no durable event |
112112

113113
## Three axes
114114

@@ -2377,19 +2377,28 @@ second fails the body, evaluates nothing, and the first value is not published
23772377
there is no first-wins or last-wins fallback. A body that executes none reports
23782378
that instead, which is how a bounded search that found nothing reports itself.
23792379

2380-
**Selection is not a decision a document makes about itself.** The context this
2381-
travels through is named, and a named context is reachable by name from a
2382-
document's own eval block, so nothing that decides a value may live in it. What
2383-
it carries is a frozen carrier holding no facts, only an accessor guarded by an
2384-
unexported `Symbol()`; who owns the body, what schema it declares, whether it is
2385-
claimed, and which value it selected live in that carrier's own closure, whose
2386-
lifetime is one execution of one body. A carrier the engine did not mint owns
2387-
nothing β€” it cannot supply the token, and state it fabricates lacks the mark the
2388-
engine puts on its own β€” so a forged one makes a `<Return>` reserved rather than
2389-
selecting through it. Both settlement sites read the carrier their own body
2390-
minted and has held since, never one read back from the context. Mutating
2391-
the carrier, recreating the context, or replacing it therefore selects and
2392-
publishes nothing, and a value still crosses its declared schema on the way out.
2380+
**Selection is not a decision a document makes about itself.** A document's own
2381+
eval block reaches further than it looks: a named context by name, because
2382+
`createContext(name)` names the slot the engine would publish on, and an internal
2383+
module by file URL, because an eval block's imports are hoisted and resolved like
2384+
any other module's. Anything published contextually is therefore readable, and
2385+
any exported function acting on what was published is callable β€” a sealed carrier
2386+
in a context plus an exported `claim(carrier)` is forgeable however carefully the
2387+
carrier itself is sealed, because the document calls the engine's own helper with
2388+
the engine's own carrier.
2389+
2390+
So selection uses neither. The body that owns a value is a plain object whose
2391+
claim, selection and settlement are closures over state nothing else holds, and
2392+
it reaches the `<Return>` that claims it as an ordinary parameter of expansion β€”
2393+
down the call stack, which document code cannot read or replace. Ownership is
2394+
explicit at every site rather than ambient: a component invocation passes none,
2395+
so an invoked body is isolated; caller projection passes the caller's, so
2396+
projected content still satisfies the declaration its author could see; and
2397+
dynamically scanned markdown and generated fragments pass none. Both settlement
2398+
sites read the body their own expansion created and held as a local. Importing
2399+
the module that defines one gains a document nothing β€” it gets a body of its own,
2400+
connected to no execution β€” so a value still crosses its declared schema on the
2401+
way out.
23932402

23942403
Selection is not authority and not durable state: it appends no journal event, a
23952404
partial replay reconstructs it while completed effects replay, and a completed

0 commit comments

Comments
Β (0)