A broad API can still have one front door; the fire exits just need labels.
1. Motivation
Importing every provider class, Registry helper, query fragment, and interface compiler into first-user code makes the package look harder than the application. Hiding all advanced seams creates the opposite problem: integrations depend on private modules. HeavenBase keeps a broad lazy root facade while recommending one small first-read surface. Application examples start withimport heavenbase as hb; advanced authors move into owning packages only when their task requires that boundary.
2. Start with the Primary Surface
3. Use the Correct Workspace Entry Point
Explicit
preset= or backends= values assert the durable construction. Conflicts raise FileExistsError. release() removes the live facade while preserving Backend data; drop() destroys owned physical data.
4. Keep Schema and Row Lifecycles Separate
hb.Agent resolve through hb.DEFAULT_CONTEXT. Cross-Context code should use the canonical class from the target workspace instead of treating Python class identity as durable.
5. Treat Queries and Frames as Values
hb.Query; there is no mutable builder, copy, or fork API. execute() recomputes and returns a newly detached hb.ResultFrame.
Use an explicit result exit:
rows()for JSON-like row dictionariesscalar()for one-cell terminal resultsto_pandas(),to_pyarrow(),to_numpy(),to_pydantic(), orto_daft()for typed consumersidsandcolumn(...)for focused inspection
query.explain() to inspect selected Backends, strategies, handlers, native/fallback mode, and unsupported reasons before relying on provider behavior.
6. Use Context-Bound Agent and LLM APIs
full is an administrative profile, not the default for untrusted agents.
Concrete Toolkit persistence is workspace-owned. Toolkit.register, load, list, describe, and delete accept ws=; omission uses existing-only hb.HeavenBase.load() and never creates a hidden Toolkit store.
7. Use Advanced APIs from Their Owners
Use
hb.ext for Registry-backed backend, handler, strategy, operation, profile, serializer, and Extension authorship. Keep normal application onboarding on the root facade.
8. Avoid Retired Compatibility Paths
The 0.1.2.1 architecture has no compatibility packages at:heavenbase.registryheavenbase.storageheavenbase.handlersheavenbase.frameheavenbase.discovery
heavenbase.utils.registry, heavenbase.placement, heavenbase.execution, and heavenbase.capabilities instead. SQL resources live under heavenbase.database.resources.sql; Toolkit prompts live under heavenbase.toolkit.prompts.
9. Read the API Contract Conservatively
- Public root exports are lazy where implementation imports are heavy.
- Registered tags describe semantic claims; they do not prove executable support.
- Independent Backends do not form a distributed transaction.
- Workspace manifests export construction, requested Extension roots, and schema, not row data.
- Installed executable modules and Capsules are trusted code boundaries.
- Provider-specific native behavior should be verified with
explain()and focused tests.
Summary
- Primary APIs own application workflows; advanced APIs expose narrow engine seams.
- Context and workspace arguments preserve runtime authority.
- Retired compatibility packages are not extension points.

