FR-001checkpassingThe engine MUST import nothing of the library and nothing but the kernel; it MUST declare no contribution point of a layer, so that a layer declares its own with the engine's mechanism and the engine does not know the layers.
0002-engine · owner if · domain data
FR-001checkpassingThe engine MUST import nothing of the library and nothing but the kernel; it MUST declare no contribution point of a layer, so that a layer declares its own with the engine's mechanism and the engine does not know the layers.
FR-002checkpassingA contribution point MUST be a typed, named value (point<T>(name)), where T is what an extension contributes and the name has a namespace and a name (governance.vocabulary); a name with no namespace MUST NOT compile.
Cited by: engine/point, Data
FR-003checkpassingAn extension MUST be one typed value, a manifest made by defineExtension: its identifier (a branded ExtensionId: lower-case words joined by - or .), its version, the version of the engine's contract it was written for, the extensions it requires, what it contributes (each made by contribute(point, value)), the handles it uses, and an optional activate function; it MUST be TypeScript, never YAML, XML or JSON.
Cited by: engine/id, engine/manifest, Data
FR-004checkpassingA manifest's contributions MUST be typed by the point they fill, so that a contribution of another type to a point does not compile.
FR-005checkpassingA project MUST compose its extensions by passing them to compose, an explicit list; the engine MUST NOT scan folders for extensions and MUST NOT register an extension by its being imported.
Cited by: engine/compose, Data
FR-006checkpassingcompose MUST put the extensions in an order that satisfies requires, the order the project listed them where requires does not decide, and MUST return as values (never by throwing), all together, each missing extension, each cycle, each contract version the engine does not have, each handle used and not provided, and each identifier that two extensions claim.
FR-007checkpassingWhat a layer needs of its extensions MUST reach it as a value the project passes in (the contributions of a point, in order), not as a registry the layer looks into.
FR-008checkpassingAn extension MAY be given as a lazy entry (lazyExtension: identifier, version, contract, requires, the events that start it, and load, a thunk such as () => import(...)), and the engine MUST load and activate it only when fire is given one of its events, after the extensions it requires; an extension activated twice, even at once, MUST be activated once; a lazy extension's contributions MUST appear only after it is activated; a load whose manifest has another identifier, and an activate or a load that fails, MUST be returned as values.
FR-009checkpassingactivate MUST receive a context whose use(handle) gives only a handle the manifest declared in uses, and only what the project provided for it (provide(handle, value)); any other is an error value (undeclared, unprovided). A handle is a typed, named value of the engine's mechanism (handle<T>(name)) and the engine defines none of the layers' handles (the trace graph, the statements to emit, the files to write: each layer defines its own), so that an extension has no reach beyond what it declared; this is a discipline, not a sandbox, and the check of FR-004 in 0001-layers is what keeps an extension to the public surfaces.
Cited by: engine/compose, engine/handle, Data
point("vocabulary") with no namespace: does not compile, per FR-002.privacy: compose returns the conflict, per FR-006.compose returns the missing one, per FR-006.compose returns the cycle, per FR-006.load returns a manifest with another identifier: returned as a value, and nothing is activated, per FR-008.activate that throws: returned as a value that names the extension, which is not active, per FR-008.use on a handle it did not declare: undeclared, per FR-009.compose returns it, per FR-006.OQ-1open questionThe events an extension may be activated by, which the layers declare (onDialect:postgres, onGenerate:rust).
SC-001success criterionA layer can be extended without the engine knowing it, and an extension written outside the repository composes with one written inside it.
SC-002success criterionA mistake in a list of extensions is a value the project can show, never an exception from deep inside a layer.
engine/compose, engine/handle, engine/id, engine/manifest, engine/point, Data, The layers