Cell environment view¶
The cell environment view is the complete filesystem and Python import view available to one running block. It is assembled from the block and project dependencies that were resolved before execution. A block cannot discover or import an undeclared package merely because that package exists elsewhere in the foundation or on the host.
What appears in the cell¶
| Location | Contents | Access |
|---|---|---|
/xck/foundation |
The selected Runtime Foundation | Read-only |
/xck/capsule |
The block's execution capsule | Read-only |
/xck/components/<digest> |
Components selected by the block | Read-only |
/xck/project-system/<digest> |
Native project-wide components declared in runtime.xratu |
Read-only |
/xck/tmp |
Private temporary working space for this cell | Read and write |
These locations are stable from the block's perspective. XCK verifies the selected artifacts before the cell starts and refuses a launch when the view does not match the resolved project release. The temporary area is private to the cell, bounded in size and cannot be used to execute files or introduce privileged filesystem objects.
Python imports¶
Python searches only these sources, in order:
- the capsule, containing the block code and generated adapter;
- Python components selected by that block's declarations;
- the runtime provider, containing the Python standard library.
Python starts in isolated mode. Host environment variables, the user site directory and ambient host packages do not extend the search path.
Project-wide system components supply native libraries and executables. They do
not silently become Python packages for every block. A block that needs a
Python distribution declares it in its own @xratu dependencies.
How import ownership is enforced¶
Every top-level Python module has one selected owner. Two selected components cannot claim the same module name. XCK also remembers modules available in the foundation that this block did not select.
| Import condition | Result |
|---|---|
| The module belongs to one selected source | Imported from that source |
| The module exists in the foundation but was not selected | UndeclaredDependency |
| The module is absent from the resolved view | EnvironmentViewMismatch |
UndeclaredDependency means the required bytes are available to build a new
closure, but the block has not declared authority to use them. Add the package
to the block's @xratu declaration and rebuild the project. See
Undeclared dependency.
Example¶
Suppose a block declares the Python package requests, while the project
declares a native package in runtime.xratu:
- the block code appears under
/xck/capsule; - the selected
requestscomponent appears under/xck/components/…and is on that block's Python search path; - the native project component appears under
/xck/project-system/…and is available to every cell in the project; - another Python framework present in the foundation remains unavailable until the block declares it.
Related: Native loader view explains native library visibility, and Mount scopes and root scopes explains which declaration makes a component available.