Documentation
¶
Overview ¶
Package workers will be the workers module: the sandbox runtime, the worker catalogue, executions and hook bindings.
Role ¶
workers module, module root. Only app imports a module root; other modules reach workers through workers/api (decision 0044, dependency rules). Its storage skeleton (the module's ports, models and store adapters) sits in subpackages ahead of its phase; skeleton modules get no constructor until then (decision 0044, composition and HTTP).
Inputs ¶
None yet. Planned: the Deps that app passes to New, among them the artifacts/api Items, the access/api Authorizer and the event bus (target layout, line 672).
Outputs ¶
None yet. Planned: module.go with New(Deps), and the module's gates, which app registers on artifacts and access (target layout, lines 713-714 and 801-802). The module's layers are its subpackages: api, core, adapters/http and adapters/sandbox.
References ¶
- Context map, workers row, as https://github.com/weaveplatform/artifactweave/issues/958 records it: owns the sandbox runtime, the worker catalogue, executions and hook bindings; phases P17.
- Target layout: docs/research/architecture-options/5-modular-monolith.md, "Workers (P17), a roadmap domain end to end", lines 668-715, and "A BEFORE_DOWNLOAD worker blocks a download (P17)", lines 926-937.
- Decision 0044: docs/research/decisions/0044-modular-monolith-migration.md, "Placeholders" and "Composition and HTTP".
- Decision 0026: docs/research/decisions/0026-workers-runtime.md.
- Plan: docs/implementation/plan.md#p17-workers.
Status ¶
Placeholder: implemented by P17.
Directories
¶
| Path | Synopsis |
|---|---|
|
adapters
|
|
|
http
Package workershttp will serve the Workers endpoints, v1 and v2: worker definitions, test, execute and rerun.
|
Package workershttp will serve the Workers endpoints, v1 and v2: worker definitions, test, execute and rerun. |
|
inmem
Package inmem is the in-memory implementation of the workers module's stores: worker definitions, their state, their secrets and their executions.
|
Package inmem is the in-memory implementation of the workers module's stores: worker definitions, their state, their secrets and their executions. |
|
sandbox
Package sandbox will run worker code in helper processes: a pool with one execution per helper, the parent side of the pipe protocol, and TypeScript transpilation.
|
Package sandbox will run worker code in helper processes: a pool with one execution per helper, the parent side of the pipe protocol, and TypeScript transpilation. |
|
sandbox/host
Package host will be the helper-process side of the sandbox: the goja runtime, the platform client and allow-listed outbound HTTP.
|
Package host will be the helper-process side of the sandbox: the goja runtime, the platform client and allow-listed outbound HTTP. |
|
sql
Package sql is the SQL implementation of the workers module's stores: worker definitions, their state, their sealed secrets and their executions, with the module's registration with the SQL layer.
|
Package sql is the SQL implementation of the workers module's stores: worker definitions, their state, their sealed secrets and their executions, with the module's registration with the SQL layer. |
|
sql/migrations
Package migrations holds the workers module's migration stream: the SQLite and PostgreSQL schema of the tables the module's SQL adapter owns.
|
Package migrations holds the workers module's migration stream: the SQLite and PostgreSQL schema of the tables the module's SQL adapter owns. |
|
storetest
Package storetest is the contract suite of the workers module's stores: one set of expectations that every implementation of the worker store must meet.
|
Package storetest is the contract suite of the workers module's stores: one set of expectations that every implementation of the worker store must meet. |
|
Package api will be the workers module's published interface: worker administration and execution, and the module's events.
|
Package api will be the workers module's published interface: worker administration and execution, and the module's events. |
|
Package core will hold the workers module's logic: the action catalogue, bindings, gates, event subscriptions, executions, history and limits.
|
Package core will hold the workers module's logic: the action catalogue, bindings, gates, event subscriptions, executions, history and limits. |
|
model
Package model holds the workers module's entity values: worker definitions with their event filters, the limits on a worker's source and state, and the record of each execution.
|
Package model holds the workers module's entity values: worker definitions with their event filters, the limits on a worker's source and state, and the record of each execution. |
|
port
Package port declares the workers module's store ports: the worker store and Store, the part of the metadata store the module uses.
|
Package port declares the workers module's store ports: the worker store and Store, the part of the metadata store the module uses. |