A workspace is not a database; it is the air-traffic controller that refuses to become an airplane.
1. Motivation
A data application often grows one global registry for providers, another for plugins, and a third set of imports that quietly decides which built-ins exist. That makes inspection import code, makes external packages second-class, and lets two workspaces accidentally share machine state. HeavenBase 0.1.2.2 uses one standard-library Registry kernel, oneContext owner, and one module-folder protocol. Built-in and external records follow the same install, inspect, resolve, validation, and lifecycle path. The workspace then coordinates only the schemas, backends, routing, rows, and tools that belong to that application boundary.
This matters because extension provenance should answer “where did this record come from?”, not “which privileged branch executes it?”
2. Keep the Public Mental Model Small
Most applications need one import, one workspace, and explicit exits from query results:HeavenBase(...) creates an absent durable workspace or compatibly reopens it. register() establishes schema; row CRUD never creates schema as a side effect. Query transforms return new immutable values, execute() recomputes, and rows() explicitly crosses the ResultFrame transport boundary.
3. See the Three Ownership Boundaries
- Context owns machine configuration, the Registry store, module resolution, and live workspace identity.
- ModuleService owns declarative records, exact
meta.yamldiscovery, verified local artifacts, inspection, resolution, and lifecycle. - Workspace owns application schemas, backend instances, placement, query routing, rows, fixed metadata entities, enabled extensions, and agent-facing tools.
hb.DEFAULT_CONTEXT is a convenience for unbound calls. An explicitly constructed Context remains the authority for every nested lookup in its workspaces.
4. Understand the Workspace Foundation
Catalog and MetaSchema are fixed workspace-foundation entities. They are not replaceable extension content. Catalog describes concrete objects; MetaSchema projects safe schema, placement, extension, and Registry-backed metadata for inspection.
Capsule is the required extension root because Toolkits persist callable references through Capsule rows. Toolkit and Prompt are packaged default roots. Agent, Memory, and Database are optional roots. A workspace snapshots requested optional roots and recomputes exact Extension.requires dependencies when it reopens.
5. Follow Data from Meaning to Storage
AnEntity class compiles into an isolated EntitySchema. Registration resolves each field’s authored storage rule against installed placement profiles and the workspace’s named backends. The result is one canonical storage plan.
Writes materialize and validate a logical row, group physical fragments by backend, and execute row operations. Reads reverse those routes and merge fragments by stable object_id. Successful non-foundation writes publish Catalog rows after the data mutation.
Queries follow the same ownership direction:
Query.explain() reports the selected native, adapter, scan, fallback, or unsupported route.
6. Treat Modules as Data Before Code
Every cohesive built-in or external module folder uses one exactmeta.yaml. Its items may declare entities, extensions, backend types, handlers, operations, reducers, strategies, logical types, Toolkit families, MCP profiles, serializers, tags, or other registered roles.
meta.tags; optional tag definitions add diagnostics without closing the vocabulary.
Local source: path modules are captured as immutable content-addressed artifacts during installation. Remote acquisition, signatures, and ecosystem trust remain future work.
7. Keep Queries and Results as Values
There is no mutableQueryBuilder. Each query method returns a new hb.Query, so branching is ordinary assignment:
execute() returns a newly detached hb.ResultFrame. Use rows(), scalar(), to_pandas(), to_pyarrow(), to_numpy(), to_pydantic(), or to_daft() to choose the consumer boundary explicitly.
One workspace can route a query across multiple backends, but independent providers do not become a distributed transaction. Portable scan or fold execution is deliberate when a provider cannot prove equivalent native semantics.
8. Find the Current Source Owners
The retired
heavenbase.registry, heavenbase.storage, heavenbase.handlers, heavenbase.frame, and heavenbase.discovery packages are not compatibility surfaces.
9. Preserve the Architectural Invariants
- Add an open extension through Registry records and the shared module protocol, not a central provider switch.
- Keep Context ownership explicit when isolation matters; do not fall back to ambient defaults inside a bound workspace.
- Register schema before CRUD and keep row operations free of hidden schema lifecycle.
- Treat tags as descriptive metadata and
explain()as concrete execution evidence. - Keep CLI, dashboard, MCP, and other interfaces thin over owning APIs.
- Treat installed executable modules, Capsules, pickle data, and local artifacts as trusted code or trusted-local data.
Summary
- Context, workspace, and module ownership remain explicit.
- Registry records are data before implementations are imported.
- Query values, execution plans, and detached frames keep boundaries inspectable.

